[MIG] web_widget_open_tab: Migration to 17.0

This commit is contained in:
Marcos Oitaben
2023-11-16 11:04:12 +01:00
parent 5c423c80e9
commit 5ab1cf6550
5 changed files with 35 additions and 12 deletions

View File

@@ -0,0 +1 @@
from . import test_main

View File

@@ -0,0 +1,21 @@
from odoo.tests import common
class Test(common.TransactionCase):
def test_add_open_tab_field(self):
self.env["ir.model"]._get("res.company").add_open_tab_field = True
arch, view = self.env["res.company"]._get_view(view_id=None, view_type="tree")
found = arch.xpath("//field[@widget='open_tab']")
self.assertEqual(len(found), 1)
def test_no_add_open_tab_field(self):
self.env["ir.model"]._get("res.company").add_open_tab_field = False
arch, view = self.env["res.company"]._get_view(view_id=None, view_type="tree")
found = arch.xpath("//field[@widget='open_tab']")
self.assertFalse(found)
def test_add_open_tab_field_no_name_field(self):
self.env["ir.model"]._get("res.groups").add_open_tab_field = True
arch, view = self.env["res.groups"]._get_view(view_id=None, view_type="tree")
found = arch.xpath("//field[@widget='open_tab']")
self.assertEqual(len(found), 1)