From 662a5c0ba95b8029262080b7ccdfd27d153276a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Wed, 22 Jun 2022 14:28:43 +0000 Subject: [PATCH] [FIX] account_edi_ubl_cii: Prevent error when zip is not set (since https://github.com/odoo/odoo/commit/b467c2c6536d291ac9b4d426f964fb1d9e309e3f). TT36147 closes odoo/odoo#95139 X-original-commit: b84d61bcf6755e02fd567e4698bda488211ca2eb Signed-off-by: Florian Gilbert (flg) --- addons/account_edi_ubl_cii/models/account_edi_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_edi_ubl_cii/models/account_edi_common.py b/addons/account_edi_ubl_cii/models/account_edi_common.py index debb438ad37..ce830396e3e 100644 --- a/addons/account_edi_ubl_cii/models/account_edi_common.py +++ b/addons/account_edi_ubl_cii/models/account_edi_common.py @@ -131,7 +131,7 @@ class AccountEdiCommon(models.AbstractModel): # add Norway, Iceland, Liechtenstein european_economic_area = self.env.ref('base.europe').country_ids.mapped('code') + ['NO', 'IS', 'LI'] - if customer.country_id.code == 'ES': + if customer.country_id.code == 'ES' and customer.zip: if customer.zip[:2] in ('35', '38'): # Canary # [BR-IG-10]-A VAT breakdown (BG-23) with VAT Category code (BT-118) "IGIC" shall not have a VAT # exemption reason code (BT-121) or VAT exemption reason text (BT-120).