City Completion in Odoo 17

It is the time of the year where we start using the latest version of Odoo and what a surprise when we find out that the feature of city completion was not working as expected. So I setting Switzerland as country and filling partially city name or zip number should automatically fill the three fields with the correct values




After this situation is when it comes to my mind the song of Tame Impala “It feels like we only go backwards baby” 🙂


A deeper investigation brought us to the conclusion that we had a mess between obsolete code coming from a third party, the OCA variant (base_location + base_geolocalization_xx) and the enterprise modules of v15 that now is compacted (……) and the future solution in v17


So the one who does not feels sometimes lost with finding out the most convenient variant between Odoo core, OCA proposal, 3rd party apps or grabbing a developer and start from scratch  is “free to throw the first stone” - Gospel of John (8:7) in the Christian New Testament -


Said all this, here the steps to configure city completion in v17 starting from a fresh database


a) install base_address_extended


b) find the data to fill the postal codes, city, canton, and country. We used next source




c) import that file in Odoo, 


we did replace the state column content from the code, as example "VD" by the name of the canton "Vaud". Then Odoo will recognize the values of the fields "city", "zip", "country" and "state" which is the canton in case of Switzerland


d) Enable the city completion feature in country "switzerland"


 

e) finally enjoy the feature, setting Switzerland as country, and partially filling any of the other three fields will fill completely all the fields involved


 


 Kiko Serrano

 Odoo full stack developer


Sign in to leave a comment