From 695ff395cd9d4a6f575273736ed0af49d5ca3554 Mon Sep 17 00:00:00 2001 From: AMZIL Ayoub Date: Fri, 15 Mar 2024 15:37:51 +0000 Subject: [PATCH] [FIX] l10n_id: adapt the check to the new VAT regulation The issue: Currently, in Indonesia, the regulation for tax ID is 15 digits. But a new regulation is coming where Tax ID is now 16 digits by adding 0 in front The fix: Remove the first zero and leave the rest for the _run_vat_test function Related PR: #146111 opw-3782636 closes odoo/odoo#157885 Signed-off-by: Quentin De Paoli --- addons/base_vat/models/res_partner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/base_vat/models/res_partner.py b/addons/base_vat/models/res_partner.py index 3074c73811c..1bef4eb8555 100644 --- a/addons/base_vat/models/res_partner.py +++ b/addons/base_vat/models/res_partner.py @@ -769,7 +769,7 @@ class ResPartner(models.Model): # VAT is only digits and of the right length, check the Luhn checksum. try: - luhn.validate(vat[0:9]) + luhn.validate(vat[0:9] if len(vat) == 15 else vat[1:10]) except (InvalidFormat, InvalidChecksum): return False