diff --git a/l10n_it_fatturapa_import_zip/tests/data/xml_import.zip b/l10n_it_fatturapa_import_zip/tests/data/xml_import.zip index 31e589cab602..f9ef1e297466 100644 Binary files a/l10n_it_fatturapa_import_zip/tests/data/xml_import.zip and b/l10n_it_fatturapa_import_zip/tests/data/xml_import.zip differ diff --git a/l10n_it_fatturapa_in/tests/data/IT05979361218_003.xml b/l10n_it_fatturapa_in/tests/data/IT05979361218_003.xml index 240035ebebbe..96f7597d5ef9 100644 --- a/l10n_it_fatturapa_in/tests/data/IT05979361218_003.xml +++ b/l10n_it_fatturapa_in/tests/data/IT05979361218_003.xml @@ -53,7 +53,7 @@ xsi:schemaLocation="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1. IT 03533590174 - MRORSS90E25B111T + RSSMRA90B25B111S MARIO ROSSI diff --git a/l10n_it_fiscalcode/README.rst b/l10n_it_fiscalcode/README.rst index 2ef4aafd11ec..36c111bb3496 100644 --- a/l10n_it_fiscalcode/README.rst +++ b/l10n_it_fiscalcode/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + ==================== ITA - Codice fiscale ==================== @@ -13,7 +17,7 @@ ITA - Codice fiscale .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png :target: https://odoo-community.org/page/development-status :alt: Production/Stable -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-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 @@ -46,11 +50,13 @@ Installation **Italiano** -Installare il modulo Python: `codicefiscale `__. +Installare i moduli Python: `codicefiscale `__ +e `python-stdnum `__. **English** -Install the Python package: `codicefiscale `__. +Install the Python packages: `codicefiscale `__ +and `python-stdnum `__. Usage ===== @@ -105,6 +111,8 @@ Contributors * Simone Rubino * Ooops404 * Eduard Brahas +* Phi srl + * Marco Colombo Maintainers ~~~~~~~~~~~ diff --git a/l10n_it_fiscalcode/__manifest__.py b/l10n_it_fiscalcode/__manifest__.py index 0545530547c3..d3b3bf5cf1e9 100644 --- a/l10n_it_fiscalcode/__manifest__.py +++ b/l10n_it_fiscalcode/__manifest__.py @@ -17,7 +17,7 @@ "license": "AGPL-3", "depends": ["base_vat"], "external_dependencies": { - "python": ["codicefiscale"], + "python": ["codicefiscale", "python-stdnum"], }, "data": [ "security/ir.model.access.csv", diff --git a/l10n_it_fiscalcode/model/res_partner.py b/l10n_it_fiscalcode/model/res_partner.py index a23bd557b57f..8e81112e4551 100644 --- a/l10n_it_fiscalcode/model/res_partner.py +++ b/l10n_it_fiscalcode/model/res_partner.py @@ -1,7 +1,7 @@ # Copyright 2024 Simone Rubino - Aion Tech # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from codicefiscale import isvalid +from stdnum.it.codicefiscale import is_valid from odoo import _, api, fields, models from odoo.exceptions import ValidationError @@ -30,7 +30,7 @@ def check_fiscalcode(self): # Check fiscalcode length of a person msg = _("The fiscal code must have 16 characters.") raise ValidationError(msg) - if not isvalid(partner.fiscalcode): + if not is_valid(partner.fiscalcode): # Check fiscalcode validity msg = _("The fiscal code isn't valid.") raise ValidationError(msg) diff --git a/l10n_it_fiscalcode/readme/CONTRIBUTORS.rst b/l10n_it_fiscalcode/readme/CONTRIBUTORS.rst index 12108dea8fe1..3c77221ef387 100644 --- a/l10n_it_fiscalcode/readme/CONTRIBUTORS.rst +++ b/l10n_it_fiscalcode/readme/CONTRIBUTORS.rst @@ -16,3 +16,5 @@ * Simone Rubino * Ooops404 * Eduard Brahas +* Phi srl + * Marco Colombo diff --git a/l10n_it_fiscalcode/readme/INSTALL.rst b/l10n_it_fiscalcode/readme/INSTALL.rst index ab2386fa274e..2d2247c9449a 100644 --- a/l10n_it_fiscalcode/readme/INSTALL.rst +++ b/l10n_it_fiscalcode/readme/INSTALL.rst @@ -1,7 +1,9 @@ **Italiano** -Installare il modulo Python: `codicefiscale `__. +Installare i moduli Python: `codicefiscale `__ +e `python-stdnum `__. **English** -Install the Python package: `codicefiscale `__. +Install the Python packages: `codicefiscale `__ +and `python-stdnum `__. diff --git a/l10n_it_fiscalcode/static/description/index.html b/l10n_it_fiscalcode/static/description/index.html index 5267edda8277..716fbb381f64 100644 --- a/l10n_it_fiscalcode/static/description/index.html +++ b/l10n_it_fiscalcode/static/description/index.html @@ -3,15 +3,16 @@ -ITA - Codice fiscale +README.rst -
-

ITA - Codice fiscale

+
+ + +Odoo Community Association + +
+

ITA - Codice fiscale

-

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

+

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

Italiano

Questo modulo aggiunge al partner il campo codice fiscale e permette di calcolarne il suo valore.

English

@@ -388,14 +394,16 @@

ITA - Codice fiscale

-

Installation

+

Installation

Italiano

-

Installare il modulo Python: codicefiscale.

+

Installare i moduli Python: codicefiscale +e python-stdnum.

English

-

Install the Python package: codicefiscale.

+

Install the Python packages: codicefiscale +and python-stdnum.

-

Usage

+

Usage

Italiano

Sulla scheda del partner fare clic sul pulsante Calcola CF per aprire la procedura guidata relativa al calcolo del codice fiscale.

@@ -403,7 +411,7 @@

Usage

Go to Partner and click “Compute FC” in order to open the wizard related to the fiscal code computation.

-

Bug Tracker

+

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 @@ -411,9 +419,9 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Link IT s.r.l.
  • Apulia Software
  • @@ -421,7 +429,7 @@

    Authors

-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +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.

@@ -455,5 +467,6 @@

Maintainers

+
diff --git a/l10n_it_fiscalcode/tests/test_fiscalcode.py b/l10n_it_fiscalcode/tests/test_fiscalcode.py index 5e4feb4af068..8e1b0ef93326 100644 --- a/l10n_it_fiscalcode/tests/test_fiscalcode.py +++ b/l10n_it_fiscalcode/tests/test_fiscalcode.py @@ -1,7 +1,6 @@ # Copyright 2024 Simone Rubino - Aion Tech # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from codicefiscale import isvalid from odoo.exceptions import ValidationError from odoo.tests.common import TransactionCase @@ -34,6 +33,14 @@ def test_fiscalcode_compute(self): self.assertEqual(self.partner.fiscalcode, "RSSMRA84H04H501X") def test_fiscalcode_check(self): + # Omocodia + self.env["res.partner"].create( + { + "name": "Person", + "is_company": False, + "fiscalcode": "RSSMRA70A01Z50QQ", + } + ) # Wrong FC length with self.assertRaises(ValidationError): self.env["res.partner"].create( @@ -90,8 +97,6 @@ def test_fiscal_code_check_change_to_person(self): } ) partner.fiscalcode = wrong_person_fiscalcode - # pre-condition - self.assertFalse(isvalid(partner.fiscalcode)) # Act with self.assertRaises(ValidationError) as ve: @@ -117,8 +122,6 @@ def test_fiscal_code_check_company_VAT_change_to_person(self): } ) partner.fiscalcode = company_vat - # pre-condition - self.assertFalse(isvalid(partner.fiscalcode)) # Act with self.assertRaises(ValidationError) as ve: diff --git a/requirements.txt b/requirements.txt index d481b90d3333..53a3079ac24c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,7 @@ elementpath num2words>=0.5.12 openupgradelib phonenumbers +python-stdnum unidecode xlrd xlsxwriter