v 10.0 Third Party 2
Download for v 10.0 Deploy on Odoo.sh
Technical Name l10n_es_ine_code
You bought this module and need support? Click here!
Technical Name l10n_es_ine_code

L10n_es INE Codes

National Statistics Institute codes for Spanish cities.

This module contains the codes of the National Statistics Institute (INE) for Spanish cities.
The name of the city is in Spanish, in another language (if applicable) and reordered (if applicable). These three variants of the city name are simplified (in capital letters and without diacritical characters) to facilitate comparison.
If the city name is found, the city, province and state codes can be obtained.


    city_name = self.partner_id.city
    city_name_simplified = unicodedata.normalize('NFKD', city_name).upper()
    codes = self.env['res.ine.code'].search(
        ['|', '|', '|',
        ('city_name_simplified', '=', city_name_simplified),
        ('city_name_aka_simplified', '=', city_name_simplified),
        ('city_name_reordered_simplified', '=', city_name_simplified)])
    if codes:
        state_code = codes.ine_code_state
        province_code = codes.ine_code_province
        city_code = codes.ine_code_city

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.