Skip to content

Commit

Permalink
[FIX] l10n_it_edi: do not mention the country code
Browse files Browse the repository at this point in the history
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#83311

X-original-commit: 91b4168
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
  • Loading branch information
jco-odoo committed Jan 31, 2022
1 parent 21692f2 commit dcbb4e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions addons/l10n_it_edi/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,13 @@ def format_phone(number):
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):
Expand Down

0 comments on commit dcbb4e3

Please sign in to comment.