From b3e9da31a1d468ef1c88a2ceb47728c524bc21b0 Mon Sep 17 00:00:00 2001 From: "Benjamin Frantzen (bfr)" Date: Fri, 16 Jul 2021 07:43:37 +0000 Subject: [PATCH] [FIX] l10n_it_edi: fixed zip code check for the buyer If the buyer is Italian, it must have a zip code of length 5. If the buyer is not Italian, the zip code is optional closes odoo/odoo#73883 X-original-commit: 86aa7507b0d86bd13dba303c75821048d420f647 Signed-off-by: Laurent Smet Signed-off-by: bfr-o --- addons/l10n_it_edi/models/account_edi_format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_it_edi/models/account_edi_format.py b/addons/l10n_it_edi/models/account_edi_format.py index 1344c2d7e94..7f16d802787 100644 --- a/addons/l10n_it_edi/models/account_edi_format.py +++ b/addons/l10n_it_edi/models/account_edi_format.py @@ -90,7 +90,7 @@ class AccountEdiFormat(models.Model): errors.append(_("%s must have a street.", buyer.display_name)) if not buyer.zip: errors.append(_("%s must have a post code.", buyer.display_name)) - if len(buyer.zip) != 5 and buyer.country_id.code == 'IT': + elif len(buyer.zip) != 5 and buyer.country_id.code == 'IT': errors.append(_("%s must have a post code of length 5.", buyer.display_name)) if not buyer.city: errors.append(_("%s must have a city.", buyer.display_name))