Skip to content

[FIX][14.0] l10n_it_fiscalcode - handle 'omocodia' - #5116

Open
TheMule71 wants to merge 3 commits into
OCA:14.0from
TheMule71:14.0-fc
Open

[FIX][14.0] l10n_it_fiscalcode - handle 'omocodia'#5116
TheMule71 wants to merge 3 commits into
OCA:14.0from
TheMule71:14.0-fc

Conversation

@TheMule71

Copy link
Copy Markdown
Contributor

Invece di usare https://pypi.org/project/codicefiscale/, che sembra poco mantenuta, vd. ema/pycodicefiscale#3
passiamo ad usare:
https://github.com/arthurdejong/python-stdnum
che supporta correttamente la validazione delle "omocodie".

La PR verrà portata avanti alla release successive se mergiata nella 14.

@MaurizioPellegrinet MaurizioPellegrinet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test fzionale: OK

@Borruso Borruso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@monen17 monen17 linked an issue Feb 20, 2026 that may be closed by this pull request
3 tasks
@mmircoli-nexapp

Copy link
Copy Markdown
Contributor

Ma non è simile a #4511 ? Di la si era stati blocati a cambiare libreria

@Borruso

Borruso commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Ma non è simile a #4511 ? Di la si era stati blocati a cambiare libreria

non dovrebbe spaccarsi la libreria è dipendenza Odoo base
https://github.com/odoo/odoo/blob/14.0/requirements.txt#L55

@TheMule71

Copy link
Copy Markdown
Contributor Author

Ma non è simile a #4511 ? Di la si era stati blocati a cambiare libreria

non dovrebbe spaccarsi la libreria è dipendenza Odoo base https://github.com/odoo/odoo/blob/14.0/requirements.txt#L55

Esatto, l'idea era quella, usare una libreria che dovrebbe essere installata comunque, essendo delle dipendenze di Odoo core.

@TheMule71
TheMule71 force-pushed the 14.0-fc branch 2 times, most recently from bdd026a to c5d0c4a Compare April 10, 2026 08:26
@TheMule71

Copy link
Copy Markdown
Contributor Author

La libreria nuova non supporta la generazione del CF. Quindi non possiamo liberarci completamente della vecchia.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@monen17 monen17 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grazie della PR!
Ottimo usare la nuova libreria, tra l'altro è la stessa usata in 18.0 (https://github.com/odoo/odoo/blob/5d5f5381c27f67a8655a1c18bf1802c877d4cae2/addons/l10n_it_edi/models/res_partner.py#L3) 👏

"depends": ["base_vat"],
"external_dependencies": {
"python": ["codicefiscale"],
"python": ["codicefiscale", "python-stdnum"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questa libreria è già compresa tra i requirements di Odoo (https://github.com/odoo/odoo/blob/cc0060e889603eb2e47fa44a8a22a70d7d784185/requirements.txt#L55), la puoi rimuovere da qui (e dalle modifiche a INSTALL) così vediamo se funziona tutto lo stesso?

)
partner.fiscalcode = wrong_person_fiscalcode
# pre-condition
self.assertFalse(isvalid(partner.fiscalcode))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Come mai serve togliere questi assert?
Se è solo perché non si usa più isvalid, potresti modificarli per usare il nuovo is_valid, cosa ne pensi?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puoi togliere la versione dal titolo del commit? Attualmente è
Image

Il commit deve seguire https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#71commit-message

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ho verificato la differenza tra gli zip con diff --recursive xml_import_orig xml_import_pr:

diff --color --recursive xml_import_orig/IT05979361218_003.xml xml_import_pr/IT05979361218_003.xml
56c56
<                 <CodiceFiscale>MRORSS90E25B111T</CodiceFiscale>
---
>                 <CodiceFiscale>RSSMRA90B25B111S</CodiceFiscale>
diff --color --recursive xml_import_orig/IT05979361218_004.xml xml_import_pr/IT05979361218_004.xml
56c56
<                 <CodiceFiscale>MRORSS90E25B111T</CodiceFiscale>
---
>                 <CodiceFiscale>RSSMRA90B25B111S</CodiceFiscale>

👍

{
"name": "Person",
"is_company": False,
"fiscalcode": "RSSMRA70A01Z50QQ",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confermo che con il vecchio metodo questo falliva:

>>> from codicefiscale import isvalid
>>> isvalid("RSSMRA70A01Z50QQ")
False

Il codice non è valido per l'AdE (https://telemanagrafici.agenziaentrate.gov.it/VerificaCF/Scegli.do?parameter=verificaCf) solo perché non esiste, ma come mi hai spiegato la struttura è corretta perché ha una lettera invece di un numero nella penultima posizione
👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

l10n_it_fiscalcode non supporta omocodie

6 participants