diff --git a/l10n_it_location_nuts/README.rst b/l10n_it_location_nuts/README.rst new file mode 100644 index 000000000000..ff6f51c9b157 --- /dev/null +++ b/l10n_it_location_nuts/README.rst @@ -0,0 +1,115 @@ +================== +ITA - Regioni NUTS +================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:c7b6378e29670b3bbb1c6e38ffda4d6fa742ec79eeb066e8297ececb3ec16817 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_location_nuts + :alt: OCA/l10n-italy +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_location_nuts + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +**Italiano** + +Questo modulo permette di collegare le regioni NUTS di livello 4 con le +province italiane. + +**English** + +This module allows to link the NUTS regions having level 4 with italian +provinces. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +**Italiano** + +Dopo aver installato il modulo, aprire la procedura guidata: + +Contatti / Configurazione / Localizzazione / Importa NUTS 2013 + +e confermare. + +Questo aggiornerà le regioni NUTS con i dati presenti nel +`RAMON `__ (Reference And Management +Of Nomenclatures) e le collegherà alle province già presenti in Odoo. + +**English** + +After installing the module, open the wizard: + +Contacts / Configuration / Localization / Import NUTS 2013 + +and confirm. This will update the NUTS regions with data stored in +`RAMON `__ (Reference And Management +Of Nomenclatures) and will link them with states already stored in Odoo. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Agile Business Group + +Contributors +------------ + +- Simone Rubino + +- Sergio Corato + +- `Ooops `__: + + - Giovanni Serra + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/l10n-italy `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_it_location_nuts/__init__.py b/l10n_it_location_nuts/__init__.py new file mode 100644 index 000000000000..5a7dc0f2bcae --- /dev/null +++ b/l10n_it_location_nuts/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import wizard +from .hooks import post_init_hook diff --git a/l10n_it_location_nuts/__manifest__.py b/l10n_it_location_nuts/__manifest__.py new file mode 100644 index 000000000000..6cc4e31fd00c --- /dev/null +++ b/l10n_it_location_nuts/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2018 Simone Rubino - Agile Business Group +# Copyright 2019 Sergio Corato +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "ITA - Regioni NUTS", + "summary": "Opzioni NUTS specifiche per l'Italia", + "version": "16.0.1.0.0", + "category": "Localization/Europe", + "website": "https://github.com/OCA/l10n-italy", + "author": "Agile Business Group, " "Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": [ + "base_location_nuts", + ], + "post_init_hook": "post_init_hook", +} diff --git a/l10n_it_location_nuts/hooks.py b/l10n_it_location_nuts/hooks.py new file mode 100644 index 000000000000..ebc29e2d97ac --- /dev/null +++ b/l10n_it_location_nuts/hooks.py @@ -0,0 +1,16 @@ +# Copyright 2018 Simone Rubino - Agile Business Group +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import logging + +from odoo import SUPERUSER_ID, api + +_logger = logging.getLogger(__name__) + + +def post_init_hook(cr, registry): + """Define Italian specific configuration in res.country.""" + env = api.Environment(cr, SUPERUSER_ID, {}) + italy = env.ref("base.it") + _logger.info("Setting Italy NUTS configuration") + italy.write({"state_level": 4}) diff --git a/l10n_it_location_nuts/i18n/it.po b/l10n_it_location_nuts/i18n/it.po new file mode 100644 index 000000000000..089e0d7f0700 --- /dev/null +++ b/l10n_it_location_nuts/i18n/it.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_it_location_nuts +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-10-23 10:06+0000\n" +"Last-Translator: Francesco Foresti \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.6.2\n" + +#. module: l10n_it_location_nuts +#: model:ir.model.fields,field_description:l10n_it_location_nuts.field_nuts_import__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: l10n_it_location_nuts +#: model:ir.model.fields,field_description:l10n_it_location_nuts.field_nuts_import__id +msgid "ID" +msgstr "ID" + +#. module: l10n_it_location_nuts +#: model:ir.model,name:l10n_it_location_nuts.model_nuts_import +msgid "Import NUTS items from European ShowVoc service" +msgstr "Importa elementi NUTS dal servizio European ShowVoc" + +#. module: l10n_it_location_nuts +#: model:ir.model.fields,field_description:l10n_it_location_nuts.field_nuts_import____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#~ msgid "Import NUTS items from European RAMON service" +#~ msgstr "Importazione voci NUTS dal servizio europeo RAMON" diff --git a/l10n_it_location_nuts/i18n/l10n_it_location_nuts.pot b/l10n_it_location_nuts/i18n/l10n_it_location_nuts.pot new file mode 100644 index 000000000000..583ae88e8a10 --- /dev/null +++ b/l10n_it_location_nuts/i18n/l10n_it_location_nuts.pot @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_it_location_nuts +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: l10n_it_location_nuts +#: model:ir.model.fields,field_description:l10n_it_location_nuts.field_nuts_import__display_name +msgid "Display Name" +msgstr "" + +#. module: l10n_it_location_nuts +#: model:ir.model.fields,field_description:l10n_it_location_nuts.field_nuts_import__id +msgid "ID" +msgstr "" + +#. module: l10n_it_location_nuts +#: model:ir.model,name:l10n_it_location_nuts.model_nuts_import +msgid "Import NUTS items from European ShowVoc service" +msgstr "" + +#. module: l10n_it_location_nuts +#: model:ir.model.fields,field_description:l10n_it_location_nuts.field_nuts_import____last_update +msgid "Last Modified on" +msgstr "" diff --git a/l10n_it_location_nuts/pyproject.toml b/l10n_it_location_nuts/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/l10n_it_location_nuts/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/l10n_it_location_nuts/readme/CONFIGURE.md b/l10n_it_location_nuts/readme/CONFIGURE.md new file mode 100644 index 000000000000..7ded68fc6530 --- /dev/null +++ b/l10n_it_location_nuts/readme/CONFIGURE.md @@ -0,0 +1,21 @@ +**Italiano** + +Dopo aver installato il modulo, aprire la procedura guidata: + +Contatti / Configurazione / Localizzazione / Importa NUTS 2013 + +e confermare. + +Questo aggiornerà le regioni NUTS con i dati presenti nel +[RAMON](http://ec.europa.eu/eurostat/ramon) (Reference And Management Of +Nomenclatures) e le collegherà alle province già presenti in Odoo. + +**English** + +After installing the module, open the wizard: + +Contacts / Configuration / Localization / Import NUTS 2013 + +and confirm. This will update the NUTS regions with data stored in +[RAMON](http://ec.europa.eu/eurostat/ramon) (Reference And Management Of +Nomenclatures) and will link them with states already stored in Odoo. diff --git a/l10n_it_location_nuts/readme/CONTRIBUTORS.md b/l10n_it_location_nuts/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..dccd74e6fad0 --- /dev/null +++ b/l10n_it_location_nuts/readme/CONTRIBUTORS.md @@ -0,0 +1,7 @@ +- Simone Rubino \<\> + +- Sergio Corato \<\> + +- [Ooops](https://www.ooops404.com): + + > - Giovanni Serra \<\> diff --git a/l10n_it_location_nuts/readme/DESCRIPTION.md b/l10n_it_location_nuts/readme/DESCRIPTION.md new file mode 100644 index 000000000000..03ae5116348d --- /dev/null +++ b/l10n_it_location_nuts/readme/DESCRIPTION.md @@ -0,0 +1,9 @@ +**Italiano** + +Questo modulo permette di collegare le regioni NUTS di livello 4 con le +province italiane. + +**English** + +This module allows to link the NUTS regions having level 4 with italian +provinces. diff --git a/l10n_it_location_nuts/static/description/icon.png b/l10n_it_location_nuts/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/l10n_it_location_nuts/static/description/icon.png differ diff --git a/l10n_it_location_nuts/static/description/index.html b/l10n_it_location_nuts/static/description/index.html new file mode 100644 index 000000000000..19c58754db2c --- /dev/null +++ b/l10n_it_location_nuts/static/description/index.html @@ -0,0 +1,455 @@ + + + + + +ITA - Regioni NUTS + + + +
+

ITA - Regioni NUTS

+ + +

Beta License: AGPL-3 OCA/l10n-italy Translate me on Weblate Try me on Runboat

+

Italiano

+

Questo modulo permette di collegare le regioni NUTS di livello 4 con le +province italiane.

+

English

+

This module allows to link the NUTS regions having level 4 with italian +provinces.

+

Table of contents

+ +
+

Configuration

+

Italiano

+

Dopo aver installato il modulo, aprire la procedura guidata:

+

Contatti / Configurazione / Localizzazione / Importa NUTS 2013

+

e confermare.

+

Questo aggiornerà le regioni NUTS con i dati presenti nel +RAMON (Reference And Management +Of Nomenclatures) e le collegherà alle province già presenti in Odoo.

+

English

+

After installing the module, open the wizard:

+

Contacts / Configuration / Localization / Import NUTS 2013

+

and confirm. This will update the NUTS regions with data stored in +RAMON (Reference And Management +Of Nomenclatures) and will link them with states already stored in Odoo.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Agile Business Group
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/l10n-italy project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/l10n_it_location_nuts/tests/__init__.py b/l10n_it_location_nuts/tests/__init__.py new file mode 100644 index 000000000000..45060f2edf2c --- /dev/null +++ b/l10n_it_location_nuts/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import test_nuts diff --git a/l10n_it_location_nuts/tests/test_nuts.py b/l10n_it_location_nuts/tests/test_nuts.py new file mode 100644 index 000000000000..7b461945d461 --- /dev/null +++ b/l10n_it_location_nuts/tests/test_nuts.py @@ -0,0 +1,32 @@ +# Copyright 2018 Simone Rubino - Agile Business Group +# Copyright 2022 Simone Rubino - TAKOBI +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from unittest.mock import patch + +from odoo.tests.common import TransactionCase + +from .test_nuts_request_results import create_response_ok + +MOCK_PATH = "odoo.addons.base_location_nuts.wizard.nuts_import.requests.get" + + +class TestNUTS(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + importer = cls.env["nuts.import"].create([{}]) + with patch(MOCK_PATH, return_value=create_response_ok()): + importer.import_update_partner_nuts() + cls.rome_nuts = cls.env["res.partner.nuts"].search([("code", "=", "ITI43")]) + rome_state_id = cls.env.ref("base.state_it_rm").id + cls.it_partner = cls.env["res.partner"].create({"name": "it_partner"}) + cls.it_partner.write({"state_id": rome_state_id}) + + def test_italian_nuts(self): + """ + Check that onchange method correctly bind level 4 nuts with + italian states. + """ + self.it_partner.onchange_state_id_base_location_nuts() + self.assertEqual(self.it_partner.state_id, self.it_partner.nuts4_id.state_id) diff --git a/l10n_it_location_nuts/tests/test_nuts_request_results.py b/l10n_it_location_nuts/tests/test_nuts_request_results.py new file mode 100644 index 000000000000..ecc780a0eef1 --- /dev/null +++ b/l10n_it_location_nuts/tests/test_nuts_request_results.py @@ -0,0 +1,114 @@ +from json import dumps + +from requests.models import Response + +NUTS = [ + { + "s": {"type": "uri", "value": "http://data.europa.eu/nuts/code/IT"}, + "code": {"type": "literal", "value": "IT"}, + "region_name": {"type": "literal", "value": "IT Italia"}, + "level": {"type": "literal", "value": "0"}, + }, + { + "s": {"type": "uri", "value": "http://data.europa.eu/nuts/code/IT"}, + "code": {"type": "literal", "value": "IT"}, + "region_name": {"type": "literal", "value": "IT Italia"}, + "level": {"type": "literal", "value": "0"}, + }, + { + "s": {"type": "uri", "value": "http://data.europa.eu/nuts/code/ITC"}, + "code": {"type": "literal", "value": "ITC"}, + "region_name": {"type": "literal", "value": "ITC Nord-Ovest"}, + "level": {"type": "literal", "value": "1"}, + "parent": {"type": "literal", "value": "IT"}, + }, + { + "s": {"type": "uri", "value": "http://data.europa.eu/nuts/code/ITC"}, + "code": {"type": "literal", "value": "ITC"}, + "region_name": {"type": "literal", "value": "ITC Nord-Ovest"}, + "level": {"type": "literal", "value": "1"}, + "parent": {"type": "literal", "value": "IT"}, + }, + { + "s": {"type": "uri", "value": "http://data.europa.eu/nuts/code/ITF"}, + "code": {"type": "literal", "value": "ITF"}, + "region_name": {"type": "literal", "value": "ITF Sud"}, + "level": {"type": "literal", "value": "1"}, + "parent": {"type": "literal", "value": "IT"}, + }, + { + "s": {"type": "uri", "value": "http://data.europa.eu/nuts/code/ITH"}, + "code": {"type": "literal", "value": "ITH"}, + "region_name": {"type": "literal", "value": "ITH Nord-Est"}, + "level": {"type": "literal", "value": "1"}, + "parent": {"type": "literal", "value": "IT"}, + }, + { + "s": {"type": "uri", "value": "http://data.europa.eu/nuts/code/ITI"}, + "code": {"type": "literal", "value": "ITI"}, + "region_name": {"type": "literal", "value": "ITI Centro (IT)"}, + "level": {"type": "literal", "value": "1"}, + "parent": {"type": "literal", "value": "IT"}, + }, + { + "s": {"type": "uri", "value": "http://data.europa.eu/nuts/code/ITI4"}, + "code": {"type": "literal", "value": "ITI4"}, + "region_name": {"type": "literal", "value": "ITI4 Lazio"}, + "level": {"type": "literal", "value": "2"}, + "parent": {"type": "literal", "value": "ITI"}, + }, + { + "s": {"type": "uri", "value": "http://data.europa.eu/nuts/code/ITI43"}, + "code": {"type": "literal", "value": "ITI43"}, + "region_name": {"type": "literal", "value": "ITI43 Roma"}, + "level": {"type": "literal", "value": "3"}, + "parent": {"type": "literal", "value": "ITI4"}, + }, + { + "s": {"type": "uri", "value": "http://data.europa.eu/nuts/code/ITI44"}, + "code": {"type": "literal", "value": "ITI44"}, + "region_name": {"type": "literal", "value": "ITI44 Latina"}, + "level": {"type": "literal", "value": "3"}, + "parent": {"type": "literal", "value": "ITI4"}, + }, + { + "s": {"type": "uri", "value": "http://data.europa.eu/nuts/code/ITZ"}, + "code": {"type": "literal", "value": "ITZ"}, + "region_name": {"type": "literal", "value": "ITZ Extra-Regio NUTS 1"}, + "level": {"type": "literal", "value": "1"}, + "parent": {"type": "literal", "value": "IT"}, + }, + { + "s": {"type": "uri", "value": "http://data.europa.eu/nuts/code/ITZ"}, + "code": {"type": "literal", "value": "ITZ"}, + "region_name": {"type": "literal", "value": "ITZ Extra-Regio NUTS 1"}, + "level": {"type": "literal", "value": "1"}, + "parent": {"type": "literal", "value": "IT"}, + }, + { + "s": {"type": "uri", "value": "http://data.europa.eu/nuts/code/ITZZ"}, + "code": {"type": "literal", "value": "ITZZ"}, + "region_name": {"type": "literal", "value": "ITZZ Extra-Regio NUTS 2"}, + "level": {"type": "literal", "value": "2"}, + "parent": {"type": "literal", "value": "ITZ"}, + }, + { + "s": {"type": "uri", "value": "http://data.europa.eu/nuts/code/ITZZZ"}, + "code": {"type": "literal", "value": "ITZZZ"}, + "region_name": {"type": "literal", "value": "ITZZZ Extra-Regio NUTS 3"}, + "level": {"type": "literal", "value": "3"}, + "parent": {"type": "literal", "value": "ITZZ"}, + }, +] + + +def create_response_ok(): + response = Response() + response.code = "200" + response.status_code = 200 + content = { + "head": {}, + "results": {"distinct": False, "ordered": True, "bindings": NUTS}, + } + response._content = dumps(content).encode() + return response diff --git a/l10n_it_location_nuts/wizard/__init__.py b/l10n_it_location_nuts/wizard/__init__.py new file mode 100644 index 000000000000..989078b33251 --- /dev/null +++ b/l10n_it_location_nuts/wizard/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import nuts_import diff --git a/l10n_it_location_nuts/wizard/nuts_import.py b/l10n_it_location_nuts/wizard/nuts_import.py new file mode 100644 index 000000000000..7d91dd204acb --- /dev/null +++ b/l10n_it_location_nuts/wizard/nuts_import.py @@ -0,0 +1,127 @@ +# Copyright 2018 Simone Rubino - Agile Business Group +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models + + +class NutsImport(models.TransientModel): + _inherit = "nuts.import" + _it_state_map = { + "ITG14": "base.state_it_ag", # Agrigento + "ITC18": "base.state_it_al", # Alessandria + "ITI32": "base.state_it_an", # Ancona + "ITI18": "base.state_it_ar", # Arezzo + "ITI34": "base.state_it_ap", # Ascoli Piceno + "ITC17": "base.state_it_at", # Asti + "ITF34": "base.state_it_av", # Avellino + "ITF47": "base.state_it_ba", # Bari + "ITF48": "base.state_it_bt", # Barletta-Andria-Trani + "ITH33": "base.state_it_bl", # Belluno + "ITF32": "base.state_it_bn", # Benevento + "ITC46": "base.state_it_bg", # Bergamo + "ITC13": "base.state_it_bi", # Biella + "ITH55": "base.state_it_bo", # Bologna + "ITH10": "base.state_it_bz", # Bolzano + "ITC47": "base.state_it_bs", # Brescia + "ITF44": "base.state_it_br", # Brindisi + "ITG27": "base.state_it_ca", # Cagliari + "ITG15": "base.state_it_cl", # Caltanissetta + "ITF22": "base.state_it_cb", # Campobasso + "ITG2C": "base.state_it_ci", # Carbonia-Iglesias + "ITF31": "base.state_it_ce", # Caserta + "ITG17": "base.state_it_ct", # Catania + "ITF63": "base.state_it_cz", # Catanzaro + "ITF14": "base.state_it_ch", # Chieti + "ITC42": "base.state_it_co", # Como + "ITF61": "base.state_it_cs", # Cosenza + "ITC4A": "base.state_it_cr", # Cremona + "ITF62": "base.state_it_kr", # Crotone + "ITC16": "base.state_it_cn", # Cuneo + "ITG16": "base.state_it_en", # Enna + "ITI35": "base.state_it_fm", # Fermo + "ITH56": "base.state_it_fe", # Ferrara + "ITI14": "base.state_it_fi", # Firenze + "ITF46": "base.state_it_fg", # Foggia + "ITH58": "base.state_it_fc", # Forlì-Cesena + "ITI45": "base.state_it_fr", # Frosinone + "ITC33": "base.state_it_ge", # Genova + "ITH43": "base.state_it_go", # Gorizia + "ITI1A": "base.state_it_gr", # Grosseto + "ITC31": "base.state_it_im", # Imperia + "ITF21": "base.state_it_is", # Isernia + "ITF11": "base.state_it_aq", # L'Aquila + "ITC34": "base.state_it_sp", # La Spezia + "ITI44": "base.state_it_lt", # Latina + "ITF45": "base.state_it_le", # Lecce + "ITC43": "base.state_it_lc", # Lecco + "ITI16": "base.state_it_li", # Livorno + "ITC49": "base.state_it_lo", # Lodi + "ITI12": "base.state_it_lu", # Lucca + "ITI33": "base.state_it_mc", # Macerata + "ITC4B": "base.state_it_mn", # Mantova + "ITI11": "base.state_it_ms", # Massa-Carrara + "ITF52": "base.state_it_mt", # Matera + "ITG2B": "base.state_it_vs", # Medio Campidano + "ITG13": "base.state_it_me", # Messina + "ITC4C": "base.state_it_mi", # Milano + "ITH54": "base.state_it_mo", # Modena + "ITC4D": "base.state_it_mb", # Monza e Brianza + "ITF33": "base.state_it_na", # Napoli + "ITC15": "base.state_it_no", # Novara + "ITG26": "base.state_it_nu", # Nuoro + "ITG2A": "base.state_it_og", # Ogliastra + "ITG29": "base.state_it_ot", # Olbia-Tempio + "ITG28": "base.state_it_or", # Oristano + "ITH36": "base.state_it_pd", # Padova + "ITG12": "base.state_it_pa", # Palermo + "ITH52": "base.state_it_pr", # Parma + "ITC48": "base.state_it_pv", # Pavia + "ITI21": "base.state_it_pg", # Perugia + "ITI31": "base.state_it_pu", # Pesaro e Urbino + "ITF13": "base.state_it_pe", # Pescara + "ITH51": "base.state_it_pc", # Piacenza + "ITI17": "base.state_it_pi", # Pisa + "ITI13": "base.state_it_pt", # Pistoia + "ITH41": "base.state_it_pn", # Pordenone + "ITF51": "base.state_it_pz", # Potenza + "ITI15": "base.state_it_po", # Prato + "ITG18": "base.state_it_rg", # Ragusa + "ITH57": "base.state_it_ra", # Ravenna + "ITF65": "base.state_it_rc", # Reggio Calabria + "ITH53": "base.state_it_re", # Reggio Emilia + "ITI42": "base.state_it_ri", # Rieti + "ITH59": "base.state_it_rn", # Rimini + "ITI43": "base.state_it_rm", # Roma + "ITH37": "base.state_it_ro", # Rovigo + "ITF35": "base.state_it_sa", # Salerno + "ITG25": "base.state_it_ss", # Sassari + "ITC32": "base.state_it_sv", # Savona + "ITI19": "base.state_it_si", # Siena + "ITG19": "base.state_it_sr", # Siracusa + "ITC44": "base.state_it_so", # Sondrio + "ITG2H": "base.state_it_su", # Sud Sardegna + "ITF43": "base.state_it_ta", # Taranto + "ITF12": "base.state_it_te", # Teramo + "ITI22": "base.state_it_tr", # Terni + "ITC11": "base.state_it_to", # Torino + "ITG11": "base.state_it_tp", # Trapani + "ITH20": "base.state_it_tn", # Trento + "ITH34": "base.state_it_tv", # Treviso + "ITH44": "base.state_it_ts", # Trieste + "ITH42": "base.state_it_ud", # Udine + "ITC41": "base.state_it_va", # Varese + "ITH35": "base.state_it_ve", # Venezia + "ITC14": "base.state_it_vb", # Verbano-Cusio-Ossola + "ITC12": "base.state_it_vc", # Vercelli + "ITH31": "base.state_it_vr", # Verona + "ITF64": "base.state_it_vv", # Vibo Valentia + "ITH32": "base.state_it_vi", # Vicenza + "ITI41": "base.state_it_vt", # Viterbo + } + + def _create_partner_nuts(self, nuts_data): + nuts_ids = super()._create_partner_nuts(nuts_data) + for nut in nuts_ids: + if self._it_state_map.get(nut.code, False): + nut.state_id = self.env.ref(self._it_state_map[nut.code]) + return nuts_ids