Skip to content

Commit 681b331

Browse files
committed
[FIX] adapt to 14.0
1 parent baf75de commit 681b331

File tree

3 files changed

+25
-14
lines changed

3 files changed

+25
-14
lines changed

account_vat_period_end_statement/tests/common.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,27 @@ def setUpClass(cls, chart_template_ref=None):
6868
cls.paid_vat_account = (
6969
cls.env["account.account"]
7070
.search(
71-
[("account_type", "=", "asset_current")],
71+
[
72+
(
73+
"user_type_id",
74+
"=",
75+
cls.env.ref("account.data_account_type_current_assets").id,
76+
)
77+
],
7278
limit=1,
7379
)
7480
.id
7581
)
7682
cls.received_vat_account = (
7783
cls.env["account.account"]
7884
.search(
79-
[("account_type", "=", "liability_current")],
85+
[
86+
(
87+
"user_type_id",
88+
"=",
89+
cls.env.ref("account.data_account_type_current_liabilities").id,
90+
)
91+
],
8092
limit=1,
8193
)
8294
.id
@@ -117,7 +129,7 @@ def setUpClass(cls, chart_template_ref=None):
117129
"code": "VAT.AUTH",
118130
"name": "VAT Authority",
119131
"reconcile": True,
120-
"account_type": "liability_payable",
132+
"user_type_id": cls.env.ref("account.data_account_type_payable").id,
121133
}
122134
)
123135

l10n_it_vat_settlement_date/tests/test_vat_period_end_statement.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_statement(self):
5656
new_authority_vat_amount,
5757
"This assertion and the cache invalidation can be removed",
5858
)
59-
tax.invalidate_recordset(
59+
tax.invalidate_cache(
6060
fnames=[
6161
"deductible_balance",
6262
],
@@ -76,9 +76,10 @@ def _get_report(self, statement):
7676
report_action = self.env.ref(
7777
"account_vat_period_end_statement.report_vat_statement"
7878
)
79-
html, _report_type = self.env["ir.actions.report"]._render_qweb_html(
80-
report_action.report_name, statement.ids
79+
report = self.env["ir.actions.report"]._get_report_from_name(
80+
report_action.report_name
8181
)
82+
html = report._render_qweb_html(statement.ids)[0]
8283
return html
8384

8485
def test_report(self):
@@ -110,7 +111,7 @@ def test_report(self):
110111
# Act
111112
# Invalidate the tax's cache otherwise the same (correct) values
112113
# computed by the statement are printed in the report
113-
tax.invalidate_recordset(
114+
tax.invalidate_cache(
114115
fnames=[
115116
"deductible_balance",
116117
],

l10n_it_vat_settlement_date/tests/test_vat_registry.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from dateutil.relativedelta import relativedelta
77

8-
from odoo.cli import Command
98
from odoo.tests import Form, tagged
109
from odoo.tools import format_date
1110

@@ -31,7 +30,7 @@ def setUpClass(cls, chart_template_ref=None):
3130
"name": "Supplier",
3231
"layout_type": "supplier",
3332
"journal_ids": [
34-
Command.set(cls.supplier_journal.ids),
33+
(6, 0, cls.supplier_journal.ids),
3534
],
3635
}
3736
)
@@ -53,11 +52,10 @@ def _get_report(self, from_date, to_date, tax_registry):
5352
report_name = report_action["report_name"]
5453
report_context = report_action["context"]
5554
report_data = report_action["data"]
56-
html, _report_type = (
57-
self.env["ir.actions.report"]
58-
.with_context(**report_context)
59-
._render_qweb_html(report_name, wizard.ids, data=report_data)
60-
)
55+
report = self.env["ir.actions.report"]._get_report_from_name(report_name)
56+
html = report.with_context(**report_context)._render_qweb_html(
57+
wizard.ids, data=report_data
58+
)[0]
6159
return html
6260

6361
def test_report(self):

0 commit comments

Comments
 (0)