For address standardization the major requirements would be
- Addresses should be from predefined values so that reporting and analytics is easier
- Addresses should be correct as in if a certain pincode is entered the corresponding state, city should be auto filled
For this we can create a doctype in frappe similar named Geographical Territory similar to the Territory doctype in erpnext. An additional attribute will be the tree level so that we can filter on it
Next, in system settings we can have a check field to enable address standardization. If that is checked using property setter we then change the fieldtype of city, county, state, pincode to link and add link to Geographical Territory Doctype with filters on tree levels for each one
Then on click event on each field modify the link filters for all other fields
Another suggestion is to change the docfield names in Address doctype from city, county, state etc to administrative_level_1, administrative_level_2 etc as used by google maps and make the labels configuarble in geo/country_info.json.
Is this approach proper? Any suggestions on alternative ways would be great