From b7248f6060477b0d7b4b98bc334263ec2d6a4d66 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Tue, 18 Jan 2022 08:51:36 +0000 Subject: [PATCH] [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 Signed-off-by: Josse Colpaert --- addons/l10n_it_edi/models/account_invoice.py | 4 ++++ 1 file changed, 4 insertions(+) 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):