[FIX] l10n_it_edi: do not mention the country code

Italians do not always mention the country code in the VAT
number of the partner, but we can suppose in that case that
it is within Italy.  Instead of IT0477472701, they would put
just 0477472701.

closes odoo/odoo#83324

X-original-commit: 91b4168b5481d57e6af6e0c64895e97e47303ae8
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
This commit is contained in:
Josse Colpaert
2022-01-31 10:07:26 +00:00
parent cdaa43ac61
commit b7248f6060
@@ -126,9 +126,13 @@ class AccountMove(models.Model):
return False
def get_vat_number(vat):
if vat[:2].isdecimal():
return vat.replace(' ', '')
return vat[2:].replace(' ', '')
def get_vat_country(vat):
if vat[:2].isdecimal():
return 'IT'
return vat[:2].upper()
def in_eu(partner):