summaryrefslogtreecommitdiff
path: root/odoo/tools/template_inheritance.py
diff options
context:
space:
mode:
authorLucas Perais (lpe) <lpe@odoo.com>2019-12-02 10:18:33 +0000
committerLucas Perais (lpe) <lpe@odoo.com>2019-12-04 13:06:54 +0000
commite237ba26f7fbe687ff87ed5311549671d5682515 (patch)
tree2bb0a4c450eca5ea3bc7fbc5e1eba30d011822be /odoo/tools/template_inheritance.py
parent96ab29c9873ee3d0f603068c6bc0c2d4056a3081 (diff)
[IMP]: web, tools: static inheritance do not disclose t-inherit* directives
Before this commit, when a template was inheriting from another the template mentionned its t-inherit This has been deemed overkill as the information is irrelevant to the caller i.e. the caller just wants the template and doesn't care how they've been computed After this commit, only t-name and attributes not related with inheritance are disclosed [FIX]: base: static inheritance propagates other attributes When doing a inherit in primary mode, the original attributes on the root node of the inheriting template were not propagated After this commit they are
Diffstat (limited to 'odoo/tools/template_inheritance.py')
-rw-r--r--odoo/tools/template_inheritance.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/odoo/tools/template_inheritance.py b/odoo/tools/template_inheritance.py
index 77f738f2e2a..ad497d99bb7 100644
--- a/odoo/tools/template_inheritance.py
+++ b/odoo/tools/template_inheritance.py
@@ -138,9 +138,10 @@ def apply_inheritance_specs(source, specs_tree, inherit_branding=False, pre_loca
else:
comment = content
source = copy.deepcopy(spec_content)
- for attr in ('t-name', 't-inherit'):
- if node.get(attr):
- source.set(attr, node.get(attr))
+ # only keep the t-name of a template root node
+ t_name = node.get('t-name')
+ if t_name:
+ source.set('t-name', t_name)
if comment is not None:
text = source.text
source.text = None