diff --git a/addons/l10n_it_edi/models/account_invoice.py b/addons/l10n_it_edi/models/account_invoice.py index 7895fde702a..22d12387c16 100644 --- a/addons/l10n_it_edi/models/account_invoice.py +++ b/addons/l10n_it_edi/models/account_invoice.py @@ -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):