From 9d5dd4a4b289a0e0554fd5a125014a963a471a6a Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 30 Sep 2024 11:56:27 +0200 Subject: [PATCH] [FIX] l10n_es_aeat: Take into account inactive tax templates Since odoo/odoo#179797, IVA 5% taxes templates are deactivated, and if you calculate an AEAT report containing them, they are not included as not being included in the m2m field. This commit takes this situation into account. TT51059 --- l10n_es_aeat/models/l10n_es_aeat_report_tax_mapping.py | 5 +++-- l10n_es_aeat/views/aeat_tax_code_mapping_view.xml | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/l10n_es_aeat/models/l10n_es_aeat_report_tax_mapping.py b/l10n_es_aeat/models/l10n_es_aeat_report_tax_mapping.py index 0cfec52f986..39e3b87adb6 100644 --- a/l10n_es_aeat/models/l10n_es_aeat_report_tax_mapping.py +++ b/l10n_es_aeat/models/l10n_es_aeat_report_tax_mapping.py @@ -1,5 +1,5 @@ -# Copyright 2016 Antonio Espinosa -# Copyright 2016-2017 Tecnativa - Pedro M. Baeza +# Copyright 2016 Tecnativa - Antonio Espinosa +# Copyright 2016,2024 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import _, api, exceptions, fields, models @@ -31,6 +31,7 @@ def calculate(self): tax_code_map = ( self.env["l10n.es.aeat.map.tax"] .sudo() + .with_context(active_test=False) .search( [ ("model", "=", report.number), diff --git a/l10n_es_aeat/views/aeat_tax_code_mapping_view.xml b/l10n_es_aeat/views/aeat_tax_code_mapping_view.xml index 349c581d92e..9ce03cc253c 100644 --- a/l10n_es_aeat/views/aeat_tax_code_mapping_view.xml +++ b/l10n_es_aeat/views/aeat_tax_code_mapping_view.xml @@ -1,6 +1,6 @@ @@ -23,7 +23,7 @@ - +