diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index 24451c90e89..0ae52465604 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -509,15 +509,12 @@ class HomeStaticTemplateHelpers(object):
# After several performance tests, we found out that deepcopy is the most efficient
# solution in this case (compared with copy, xpath with '.' and stringifying).
parent_tree = copy.deepcopy(self.template_dict[parent_addon][parent_name])
- parent_tag = parent_tree.tag
- # replace temporarily the parent tag so it is never the target of the inheritance
- parent_tree.tag = 't'
+
xpaths = list(template_tree)
if self.debug and inherit_mode == self.EXTENSION_MODE:
for xpath in xpaths:
xpath.insert(0, etree.Comment(" Modified by %s from %s " % (template_name, addon)))
inherited_template = apply_inheritance_specs(parent_tree, xpaths)
- inherited_template.tag = parent_tag
if inherit_mode == self.PRIMARY_MODE: # New template_tree: A' = B(A)
inherited_template.set(self.NAME_TEMPLATE_DIRECTIVE, template_name)
diff --git a/addons/web/tests/test_serving_base.py b/addons/web/tests/test_serving_base.py
index 31be8bfa89e..87c01d748dc 100644
--- a/addons/web/tests/test_serving_base.py
+++ b/addons/web/tests/test_serving_base.py
@@ -397,7 +397,7 @@ class TestStaticInheritance(BaseCase):
@@ -408,7 +408,7 @@ class TestStaticInheritance(BaseCase):
@@ -476,9 +476,9 @@ class TestStaticInheritance(BaseCase):
contents = HomeStaticTemplateHelpers.get_qweb_templates(addons=self._get_module_names(), debug=True)
expected = b"""
-
"""
@@ -510,11 +510,12 @@ class TestStaticInheritance(BaseCase):
contents = HomeStaticTemplateHelpers.get_qweb_templates(addons=self._get_module_names(), debug=True)
expected = b"""
-
"""
@@ -550,11 +551,11 @@ class TestStaticInheritance(BaseCase):
contents = HomeStaticTemplateHelpers.get_qweb_templates(addons=self._get_module_names(), debug=True)
expected = b"""
-
"""
@@ -563,7 +564,7 @@ class TestStaticInheritance(BaseCase):
def test_replace_root_node_tag(self):
"""
- Root node is not targeted by //NODE_TAG in xpath
+ Root node IS targeted by //NODE_TAG in xpath
"""
self.modules = [
('module_1_file_1', None, 'module_1'),
@@ -589,11 +590,10 @@ class TestStaticInheritance(BaseCase):
contents = HomeStaticTemplateHelpers.get_qweb_templates(addons=self._get_module_names(), debug=True)
expected = b"""
-
"""
@@ -601,7 +601,7 @@ class TestStaticInheritance(BaseCase):
def test_replace_root_node_tag_in_primary(self):
"""
- Root node is not targeted by //NODE_TAG in xpath
+ Root node IS targeted by //NODE_TAG in xpath
"""
self.maxDiff = None
self.modules = [
@@ -630,10 +630,9 @@ class TestStaticInheritance(BaseCase):
At first I was afraid
-
+
+ Form replacer
+
"""
@@ -671,10 +670,10 @@ class TestStaticInheritance(BaseCase):
-