Skip to content

Commit 1054f11

Browse files
committed
[MIG] l10n_es_digital_canon: Migration to 17.0
backport from 18.0 #4590
1 parent 82eb366 commit 1054f11

File tree

7 files changed

+164
-161
lines changed

7 files changed

+164
-161
lines changed

l10n_es_digital_canon/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Canon digital",
55
"summary": "Aplicación automática del canon digital en facturas, ventas y compras",
6-
"version": "18.0.1.0.0",
6+
"version": "17.0.1.0.0",
77
"website": "https://github.com/OCA/l10n-spain",
88
"author": "Tecnativa, Odoo Community Association (OCA)",
99
"license": "AGPL-3",

l10n_es_digital_canon/data/template/account.tax-es_common.csv

Lines changed: 153 additions & 153 deletions
Large diffs are not rendered by default.

l10n_es_digital_canon/models/account_chart_template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ def _get_es_canon_account_tax(self):
2020
"es_common", "account.tax", module="l10n_es_digital_canon"
2121
)
2222

23-
def _load_data(self, data, ignore_duplicates=False):
23+
def _load_data(self, data):
2424
"""When loading digital canon taxes, they must have a lower sequence
2525
than all other taxes so that subsequent taxes can be calculated.
2626
"""
27-
result = super()._load_data(data, ignore_duplicates=ignore_duplicates)
27+
result = super()._load_data(data)
2828
if "account.tax" not in result:
2929
return result
3030
# Get all canon digital tax groups

l10n_es_digital_canon/models/purchase_order_line.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
class PurchaseOrderLine(models.Model):
77
_inherit = "purchase.order.line"
88

9-
# pylint:disable=missing-return
109
def _compute_tax_id(self):
11-
super()._compute_tax_id()
10+
res = super()._compute_tax_id()
1211
for line in self:
1312
taxes = line.taxes_id
1413
product = line.product_id
@@ -28,3 +27,4 @@ def _compute_tax_id(self):
2827
)
2928
if tax:
3029
line.taxes_id |= tax
30+
return res

l10n_es_digital_canon/models/sale_order_line.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
class SaleOrderLine(models.Model):
77
_inherit = "sale.order.line"
88

9-
# pylint:disable=missing-return
109
@api.depends("product_id", "company_id")
1110
def _compute_tax_id(self):
12-
super()._compute_tax_id()
11+
res = super()._compute_tax_id()
1312
for line in self:
1413
taxes = line.tax_id
1514
product = line.product_id
@@ -30,3 +29,4 @@ def _compute_tax_id(self):
3029
)
3130
if tax:
3231
line.tax_id |= tax
32+
return res

l10n_es_digital_canon/reports/invoice_document_report.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616
<xpath expr="//td[@name='td_taxes']" position="after">
1717
<td
1818
name="td_canon"
19-
t-if="any(tax.tax_group_id.name.startswith('Canon digital') for tax in line.tax_ids)"
19+
t-if="any(any(tax.tax_group_id.name.startswith('Canon digital') for tax in l.tax_ids) for l in o.invoice_line_ids)"
2020
t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"
2121
>
2222
<span
2323
class="text-nowrap"
24+
t-if="sum(tax.amount * line.quantity
25+
for tax in line.tax_ids
26+
if tax.tax_group_id.name.startswith('Canon digital'))"
2427
t-esc="sum(tax.amount * line.quantity
2528
for tax in line.tax_ids
2629
if tax.tax_group_id.name.startswith('Canon digital'))"
9.23 KB
Loading

0 commit comments

Comments
 (0)