Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Localization
  3. Smart City Selection v 19.0
  4. Sales Conditions FAQ

Smart City Selection

by Yacine Bendou
Odoo
v 19.0 Third Party 17
Download for v 19.0 Deploy on Odoo.sh
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies • Contacts (contacts)
• Discuss (mail)
Lines of code 12118
Technical Name smart_city_selection_yb
LicenseLGPL-3
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies • Contacts (contacts)
• Discuss (mail)
Lines of code 12118
Technical Name smart_city_selection_yb
LicenseLGPL-3
Smart City Selection
Smart City Selection
Why Scenarios Layout Features Setup Specs Limitations Changelog Contact
Localization  ·  Odoo 19  ·  Global

Smart City Selection
for Every Country

Replace Odoo's free-text city field with a validated, country-aware dropdown — for any country, any address structure, worldwide.

Per-country toggle Consistent city names Any address structure Zero core overrides
3 models Cleanly extended
0 overrides Core Odoo untouched
LGPL-3 Free forever

The problem

Free-text city fields break your data

When users type city names manually, no two records ever look the same. Reporting breaks, deduplication fails, and geographic analysis becomes impossible — for every database, in every country.

Typos & variant spellings

The same city entered a dozen different ways. Clean reporting becomes impossible.

Duplicate partner records

Deduplication engines miss matches when the city field doesn't align across records.

Broken geographic reporting

Group-by, heat maps, and pivot tables rely on exact values. Free text makes city-level insight meaningless.

Without this module
"Paris", "paris", "PARIS" — three variants, zero clean data
State & Country must be filled in manually each time
Group-by City returns dozens of broken buckets
Any text saves — typos go completely undetected
Hours of recurring cleanup that never fully sticks
VS
With this module
One canonical city name, consistent across every record
State & Country sync automatically on city select
Clean pivot tables, heat maps & reports out of the box
Invalid cities rejected at save time, every time
Data is right from day one — zero cleanup ever needed

Built for every address structure

Works with any country worldwide

Countries have different address structures — some use states, some don't, some you want to keep as free text. This module handles all of them, in the same Odoo database, without any conflict.

Country → State → City

Country → State/Region → City

Full three-level hierarchy. Select a country, then a state — the city list automatically narrows to only cities in that region. Works for any country that uses a state or province layer: USA, France, Brazil, India, Australia, and more.

Country → City (flat)

Country → City

Many countries don't use states or provinces at all. The module supports a direct Country → City link — state is optional and never required if not configured. Works seamlessly for any country with a flat address structure.

Mixed — Dropdown & Free Text

Some countries → Dropdown
Others → Free text ✏️

Enable the validated dropdown only for countries that need it. For all others, Odoo's original free-text field stays untouched. No disruption, no forced migration, full backward compatibility — ideal for phased global rollouts.


Smarter form design

Address fields in the right order

Odoo's default layout puts Country at the bottom — after Street, City, and State. This means users fill in specific details before setting the geographic context that drives them. This module fixes the order so every field makes sense before you reach it.

Odoo default
Odoo default address field order
Street fills first — before you even know which country you're in
City and State are entered with no country context yet
Country at the very bottom — cascading is impossible
Wrong order breaks dropdown filtering before it even starts
With this module
Reordered address fields — Country first
Country first — sets the context, unlocks the state list
State second — narrows the city dropdown immediately
City third — only valid cities for that country/state appear
Street last — filled in once all geographic context is locked
Country
State
City
ZIP
Street

Broad to specific — the only order that makes geographic sense.


Core capabilities

Everything you need

City Master List

One place to define all cities: name, short id/code (up to 6 chars), country, and optional state. Import thousands of cities in seconds using Odoo's native import tool.

Cascading Filter

The city dropdown narrows and filters automatically when a state is selected. Change the country — the list resets. No stale or invalid choices ever appear.

Bidirectional Sync

Picking a city auto-syncs with State and Country. Existing free-text city values are intelligently matched back to the city list on load — no manual remapping.

Per-Country Toggle

A single checkbox on any country record enables the dropdown. Flip it off — the city field returns to free text instantly. Adopt gradually, at your own pace.

State Required Enforcement

Respects Odoo's native "State Required" flag — enforced at save time on both the city record and the partner form for airtight data quality.

Search by Name or ID/Code

The city selector searches on both the city name and the administrative ID/Code — a single field that serves as an ID for some countries and a code for others — for fast, flexible lookups across any database size.

Role-Based Access

Security CSV included. Admins create and edit the city master list; regular users get read-only access — ensuring your validated data stays clean over time.

Logical Address Layout

The address form is reordered into a natural data-entry sequence: Country → State → City → ZIP → Street → Street 2. Cascading fields are grouped logically, reducing input errors.


Step 1 — Setup

Build your city list only once

  • 1
    Enable "Cities List" per country

    Start here — Contacts → Configuration → Countries → choose a country → check the "Cities List" box. A country will not appear as a selectable option when adding cities until this is enabled. Leave it unchecked for any country you want to keep the city field as free text input.

  • 2
    Contacts → Configuration → Cities

    A dedicated menu shows all your defined cities. Create them manually or bulk-import with Odoo's native import tool — any volume, any country.

  • 3
    Link to country — state is optional

    Attach each city to a country. Add a state/region only if that country uses them. Both flat and hierarchical structures are fully supported.

Configuration

Step 2 — Daily Use

One click — complete address

  • 1
    Select the country

    As soon as a country with the "Cities List" option enabled is chosen, the city field switches from a text box to a validated smart dropdown.

  • 2
    Pick the region / state (if applicable)

    For countries with states, the city list narrows automatically. For countries with a flat structure, skip straight to the city — zero friction.

  • 3
    Select city — address complete

    Choosing a city instantly syncs State and Country. No extra clicks, no typos, no inconsistent records — ever again.

Partner Form

Use cases

Who is this built for?

Global & Multi-Country Companies

Manage partners across dozens of countries from one database. Enable validated dropdowns for the regions you need, keep free text everywhere else — zero disruption.

E-Commerce & Logistics

Reliable delivery addresses require validated cities. Eliminate failed shipments caused by inconsistent or misspelled city names — across any country you ship to.

CRM & Geographic Reporting

Standardized city names make group-by, filters, and geographic maps work correctly — enabling meaningful regional sales analysis at any scale.

Public Sector & Institutions

Government agencies and NGOs need standardized administrative geodata. Import your official city lists for any jurisdiction for full compliance and accuracy.

Odoo Implementers & Partners

Deliver cleaner client databases from day one. Add it to your standard deployment kit and preload verified city data for any country during onboarding.


"

Our partners were scattered across a dozen city variants in the CRM — same city, different spelling every single time. After installing this module and importing our city list, it took one afternoon to clean up years of messy data. Now every report, every filter, every map just works. It's the kind of fix that should have always been in Odoo.

YB
Yacine Bendou
Author · Smart City Selection

Technical details

Compatibility & specs

Odoo version 19.0
License LGPL-3
Dependencies base   contacts   sales_team
New model res.city_m2o
Extended models res.partner   res.country
Translations Arabic (ar), French (fr)
Core override? No — clean extension only
Installation Drop in addons path and install. No mandatory config required.

Before you deploy

Known Limitations

Two edge cases to be aware of when working with data imports.

Import: exact name matching

Country and state values in import files must match Odoo's exact stored names — including capitalization and accents. For example, if Odoo stores "Canada", importing with "canada" or "CANADA" will not match and the sync will fail. Always verify country and state names against your Odoo configuration before running a bulk import.

Release history

Version changelog

v 1.0.32025-04-25Latest
City sync for countries without states — no-state imports now auto-populate the city dropdown
Uniqueness constraint on city records per country/state combination
Address field reordering: Country → State → City → ZIP → Street → Street 2
State change no longer clears city if the selected city belongs to the new state
City input not cleared on state change when no city is selected from dropdown
Fixed: search by ID/code was silently returning no results
Fixed: id_code field name mismatch across views and constraint
v 1.0.02025-02-17Initial release
Initial release — new model res.city_m2o with name, id/code, country, optional state
Per-country toggle to enable dropdown or keep free-text city input
Many2one city dropdown on partner form with bidirectional compute/inverse sync
Cascading filter: country → state → city with automatic narrowing
Role-based access control — read for all, write for sale managers
Arabic and French translations included

Questions or feedback?

Bug reports and feature suggestions are always welcome.

@ yacine.bendou.01@gmail.com
Why Scenarios Layout Features Specs Limitations Changelog
Yacine Bendou
© 2025 Yacine Bendou  ·  LGPL-3  ·  Odoo 19

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with