Skip to content

Commit

Permalink
[FIX] l10n_it_fatturapa_out: avoid to add country code to PIVA for fo…
Browse files Browse the repository at this point in the history
…reign customers with italian PIVA
  • Loading branch information
odooNextev committed Nov 29, 2024
1 parent a149fa6 commit 45886f9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions l10n_it_fatturapa_out/wizard/efattura.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,14 @@ def format_quantity(line):
def get_id_fiscale_iva(partner, prefer_fiscalcode=False):
id_paese = partner.country_id.code
if partner.vat:
if (id_paese == "IT" and partner.vat.startswith("IT")) or (
id_paese == "SM" and partner.vat.startswith("SM")
id_paese_from_vat = partner.vat[:2]
if (id_paese == "IT" and id_paese_from_vat == "IT") or (
id_paese == "SM" and id_paese_from_vat == "SM"
):
id_codice = partner.vat[2:]
elif id_paese_from_vat.isalpha() and id_paese != id_paese_from_vat:
id_codice = partner.vat[2:]
id_paese = partner.vat[:2]
else:
id_codice = partner.vat
elif partner.fiscalcode or id_paese == "IT":
Expand Down

0 comments on commit 45886f9

Please sign in to comment.