Skip to content

Commit

Permalink
[FIX] l10n_es_aeat: Take into account inactive tax templates
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pedrobaeza committed Sep 30, 2024
1 parent 5eeca6e commit e4457af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions l10n_es_aeat/models/l10n_es_aeat_report_tax_mapping.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2016 Antonio Espinosa <[email protected]>
# Copyright 2016-2017 Tecnativa - Pedro M. Baeza <[email protected]>
# 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
Expand Down Expand Up @@ -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),
Expand Down
9 changes: 7 additions & 2 deletions l10n_es_aeat/views/aeat_tax_code_mapping_view.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2016 Antonio Espinosa <[email protected]>
Copyright 2018 Tecnativa - Pedro M. Baeza
Copyright 2018,2024 Tecnativa - Pedro M. Baeza
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="l10n_es_aeat_map_tax_tree" model="ir.ui.view">
Expand Down Expand Up @@ -28,7 +28,12 @@
</group>
</group>
<group string="Mapping Lines" col="4">
<field name="map_line_ids" nolabel="1" colspan="4" />
<field
name="map_line_ids"
context="{'active_test': False}"
nolabel="1"
colspan="4"
/>
</group>
</sheet>
</form>
Expand Down

0 comments on commit e4457af

Please sign in to comment.