[MIG] base_view_inheritance_extension: Migration to 16.0

pull/2494/head
Enric Tobella 2022-12-06 20:26:34 +01:00
parent 29e3e5fb4e
commit 040320c881
2 changed files with 5 additions and 6 deletions

View File

@ -3,7 +3,7 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
{
"name": "Extended view inheritance",
"version": "15.0.1.0.2",
"version": "16.0.1.0.0",
"development_status": "Mature",
"author": "Therp BV,Odoo Community Association (OCA)",
"license": "LGPL-3",

View File

@ -16,17 +16,16 @@ class TestBaseViewInheritanceExtension(TransactionCase):
def test_base_view_inheritance_extension(self):
view_id = self.env.ref("base.view_partner_simple_form").id
fields_view_get = self.env["res.partner"].fields_view_get(view_id=view_id)
view = etree.fromstring(fields_view_get["arch"])
arch, view = self.env["res.partner"]._get_view(view_id=view_id)
# Verify normal attributes work
self.assertEqual(view.xpath("//form")[0].get("string"), "Partner form")
self.assertEqual(arch.xpath("//form")[0].get("string"), "Partner form")
# Verify our extra context key worked
self.assertTrue(
"default_name" in view.xpath('//field[@name="parent_id"]')[0].get("context")
"default_name" in arch.xpath('//field[@name="parent_id"]')[0].get("context")
)
self.assertTrue(
"context.get('company_id', context.get('company'))"
in view.xpath('//field[@name="parent_id"]')[0].get("context")
in arch.xpath('//field[@name="parent_id"]')[0].get("context")
)
def test_update_context_default(self):