summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorjbm-odoo <jbm@odoo.com>2019-02-18 14:16:08 +0000
committerjbm-odoo <jbm@odoo.com>2019-02-18 15:28:23 +0000
commit8a4fe6d756aff657e3dc255bce732ac4bfb9df80 (patch)
tree01741fa067597f755831f6c41ac1a45d5ed623db /addons
parent9ba75cd7f4ebe27aac67320ff2e73fcd7116d0e5 (diff)
[FIX] l10n_it_edi: Relax zip check for non-Italian buyers.
With Italian localization, the length of zip must be 5 for Italian buyer. If the buyer is not Italian, we doesn't check his zip length. closes odoo/odoo#31205
Diffstat (limited to 'addons')
-rw-r--r--addons/l10n_it_edi/models/account_invoice.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/l10n_it_edi/models/account_invoice.py b/addons/l10n_it_edi/models/account_invoice.py
index ea28eef9a90..123081e5503 100644
--- a/addons/l10n_it_edi/models/account_invoice.py
+++ b/addons/l10n_it_edi/models/account_invoice.py
@@ -112,7 +112,7 @@ class AccountInvoice(models.Model):
raise UserError(_("%s must have a street.") % (buyer.display_name))
if not buyer.zip:
raise UserError(_("%s must have a post code.") % (buyer.display_name))
- if len(buyer.zip) != 5:
+ if len(buyer.zip) != 5 and buyer.country_id.code == 'IT':
raise UserError(_("%s must have a post code of length 5.") % (buyer.display_name))
if not buyer.city:
raise UserError(_("%s must have a city.") % (buyer.display_name))