Country Administrative Divisions

A frappe app containing the administrative divisions for all countries

Install Country Administrative Divisions

bench get-app https://github.com/hamzabawumia/country_administrative_divisions

Add the Frappe Gems badge to your README

Maintain Country Administrative Divisions? Paste this into your README:

[![Listed on Frappe Gems](https://frappegems.com/api/method/frappe_gems.seo.badge?app=hamzabawumia%2Fcountry_administrative_divisions)](https://frappegems.com/gems/apps/hamzabawumia/country_administrative_divisions)

About Country Administrative Divisions

Country Administrative Divisions

Administrative divisions (regions, districts, etc.) linked to countries.

First clone this app and install it into your project it comes with two doctypes that are already linked to the erpnext countries doctype.

  1. Admin Level 1 ProvinceRegionState(1) with the following fields: { "countryid", - links to country (erpnext country doctype) "provinceregion_state" }

  2. Admin Division Level 2 DistrictsCountyCityTown(2) with the following fields: { "admindivisionlevel1", - links to "Admin Level 1 ProvinceRegionState"(1) "districtcountycity_town" }

so in your project, you only need to link to the above doctypes and everything will work smoothly.

you should create 3 fields in your new doctype

  1. country - linked to erpnext "country" doctype
  2. provinceregionstate - linked to "Admin Level 1 ProvinceRegionState" (1)
  3. districtscountycitytown - linked to "Admin Division Level 2 DistrictsCountyCityTown"(2)

Naming conventions for the fields when creating your own fields:

Level1 Label = Province / Region / State name = provinceregionstate This links to = Admin Level 1 ProvinceRegion_State

Level2 Label = District / County / City / Town name = districtscountycitytown This links to = Admin Division Level 2 DistrictsCountyCity_Town

How to Implement the Selection Flow with Dependent or Chained Dropdown List FOR DESK:

Click the filter icon for the field you want. Build filter: ....

Operator: =

Value type: will be an Expression

example eval:doc.country (note that there is no quotes around the value)

so you are going to have something like so:

[ [, , , ]

TargetDoctype is the doctype that will be filtered

["Admin Level 1 ProvinceRegionState", "country_id", "=", "eval:doc.country"]

]

[ [, , , ]

["Admin Division Level 2 DistrictsCountyCityTown", "admindivisionlevel1", "=","eval:doc.provinceregionstate" ] ]

License

mit

Related Other apps for Frappe & ERPNext

  • Erpnext — Free and Open Source Enterprise Resource Planning (ERP)
  • Helpdesk — Modern, Streamlined, Free and Open Source Customer Service Software
  • Print Designer — Visual print designer for Frappe / ERPNext
  • Ctr — CTR模型代码和学习笔记总结
  • Whitelabel — Whitelabel ERPNext
  • Fossunited — fossunited.org
  • Helm — Helm Chart Repository for Frappe/ERPNext
  • Frappe Attachments S3 — A frappe app to upload file attachments in doctypes to s3.