summaryrefslogtreecommitdiff
path: root/addons/web/controllers
diff options
context:
space:
mode:
authorLucas Perais (lpe) <lpe@odoo.com>2020-01-30 08:41:08 +0000
committerLucas Perais (lpe) <lpe@odoo.com>2020-01-30 12:22:23 +0000
commitcfac7b37752d6810272d2b9bb8909add4ca3aaa7 (patch)
tree2225397213796f2ba799336155061c3845841520 /addons/web/controllers
parent1d872f24b153e3342886f0fd6d85b61341f63953 (diff)
[FIX] web: template inheritance from dotted name
A good practice is to always prefix the name of a template by the name of the module it is defined in. So in the case where a template ```xml <t t-name="module.template" /> ``` was inherited by another Before this commit, one should have written ```xml <t t-name="other" t-inherit="module.module.template" /> ``` After this commit, it becomes more natural, and one should only write ```xml <t t-name="other" t-inherit="module.template"/> ```
Diffstat (limited to 'addons/web/controllers')
-rw-r--r--addons/web/controllers/main.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index bf4e2aaa0fc..798077daf40 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -496,6 +496,9 @@ class HomeStaticTemplateHelpers(object):
for template_tree in list(all_templates_tree):
if self.NAME_TEMPLATE_DIRECTIVE in template_tree.attrib:
template_name = template_tree.attrib[self.NAME_TEMPLATE_DIRECTIVE]
+ dotted_names = template_name.split('.', 1)
+ if len(dotted_names) > 1 and dotted_names[0] == addon:
+ template_name = dotted_names[1]
else:
# self.template_dict[addon] grows after processing each template
template_name = 'anonymous_template_%s' % len(self.template_dict[addon])