From f9dfe9cec266ba3e5644be07a78fe299cd9199b2 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Wed, 31 Jan 2024 17:54:48 +0100 Subject: [PATCH] [FIX] l10n_es_edi_tbai: similar to sii clave regimen 02 is only exports of goods opw-3716413 closes odoo/odoo#152125 Signed-off-by: Brice Bartoletti (bib) --- addons/l10n_es_edi_tbai/models/account_edi_format.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/addons/l10n_es_edi_tbai/models/account_edi_format.py b/addons/l10n_es_edi_tbai/models/account_edi_format.py index 58c84e06f8b..32d4d2c67cd 100644 --- a/addons/l10n_es_edi_tbai/models/account_edi_format.py +++ b/addons/l10n_es_edi_tbai/models/account_edi_format.py @@ -360,11 +360,8 @@ class AccountEdiFormat(models.Model): # Regime codes (ClaveRegimenEspecialOTrascendencia) # NOTE there's 11 more codes to implement, also there can be up to 3 in total # See https://www.gipuzkoa.eus/documents/2456431/13761128/Anexo+I.pdf/2ab0116c-25b4-f16a-440e-c299952d683d - com_partner = invoice.commercial_partner_id - if not com_partner.country_id or com_partner.country_id.code in self.env.ref('base.europe').country_ids.mapped('code'): - values['regime_key'] = ['01'] - else: - values['regime_key'] = ['02'] + export_exempts = invoice.invoice_line_ids.tax_ids.filtered(lambda t: t.l10n_es_exempt_reason == 'E2') + values['regime_key'] = ['02'] if export_exempts else ['01'] if invoice.l10n_es_is_simplified: values['regime_key'].append(52) # code for simplified invoices