16.0 vanila

This commit is contained in:
Ernad Husremovic 2025-10-03 17:53:49 +02:00
parent 956889352c
commit 2e65bf056a
17 changed files with 5293 additions and 17668 deletions

View file

@ -1512,6 +1512,42 @@ class TestTemplating(ViewCase):
" the main view's"
)
def test_branding_remove_add_text(self):
view1 = self.View.create({
'name': "Base view",
'type': 'qweb',
'arch': """<root>
<item order="1">
<item/>
</item>
</root>""",
})
view2 = self.View.create({
'name': "Extension",
'type': 'qweb',
'inherit_id': view1.id,
'arch': """
<data>
<xpath expr="/root/item/item" position="replace" />
<xpath expr="/root/item" position="inside">A<div/>B</xpath>
</data>
"""
})
arch_string = view1.with_context(inherit_branding=True).get_combined_arch()
arch = etree.fromstring(arch_string)
self.View.distribute_branding(arch)
expected = etree.fromstring(f"""
<root>
<item order="1">
A
<div data-oe-id="{view2.id}" data-oe-xpath="/data/xpath[2]/div" data-oe-model="ir.ui.view" data-oe-field="arch"/>
B
</item>
</root>
""")
self.assertEqual(arch, expected)
class TestViews(ViewCase):