Skip to content

Commit

Permalink
[FIX] l10n_it_edi: Relax zip check for non-Italian buyers.
Browse files Browse the repository at this point in the history
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 #31205
  • Loading branch information
jbm-odoo committed Feb 18, 2019
1 parent 9ba75cd commit 8a4fe6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/l10n_it_edi/models/account_invoice.py
Expand Up @@ -112,7 +112,7 @@ def _check_before_xml_exporting(self):
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))
Expand Down

0 comments on commit 8a4fe6d

Please sign in to comment.