[MIG] report_label: Migration to 14.0

This commit is contained in:
Stefan Rijnhart
2021-04-20 17:28:12 +02:00
parent c6c0ef3fd4
commit c55eea9714
10 changed files with 58 additions and 46 deletions

View File

@@ -1,4 +1,4 @@
from ast import literal_eval
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests import common
@@ -14,9 +14,14 @@ class TestReportLabel(common.TransactionCase):
self.partner_label.create_action()
action = self.partner_label.run()
model = action["res_model"]
context = literal_eval(action["context"])
context["active_model"] = "res.partner"
context["active_ids"] = self.env["res.partner"].search([]).ids
context = action["context"]
context.update(
{
"active_model": "res.partner",
"active_ids": self.env["res.partner"].search([]).ids,
"discard_logo_check": True,
}
)
wizard = self.env[model].with_context(context).create({})
report_action = wizard.print_report()
self.assertEquals(report_action["type"], "ir.actions.report")