From e4457af95b1c027a71eb74b1a6e066e6c828b9e8 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 | 9 +++++++-- 2 files changed, 10 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 b4b4ee24045..3ed1af8bfce 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 @@ -30,6 +30,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 eb61733a00a..f20dab20114 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 @@ @@ -28,7 +28,12 @@ - +