Skip to content

Commit

Permalink
[FIX] ir.qweb: branding breaks editing/inheritance
Browse files Browse the repository at this point in the history
Could not edit t-field content if modified by inherit xpath,
and could not inherit qweb views with non "xpath" nodes with
`position="attributes"`.

Examples:
Can't edit: `<data><xpath expr="div[@t-field='object.test']"
position="replace"><div t-field="object.test"/></xpath></data>`

Inherit doesn't work: `<data><h1 position="replace"/><h1
class="test">tata</h1></data>`

Closes #11561
Closes #11547
  • Loading branch information
Gorash authored and odony committed Mar 31, 2016
1 parent bbb317c commit d3557de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openerp/addons/base/ir/ir_ui_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def locate_node(self, arch, spec):
def inherit_branding(self, specs_tree, view_id, root_id):
for node in specs_tree.iterchildren(tag=etree.Element):
xpath = node.getroottree().getpath(node)
if node.tag == 'data' or node.tag == 'xpath':
if node.tag == 'data' or node.tag == 'xpath' or node.get('position') or node.get('t-field'):
self.inherit_branding(node, view_id, root_id)
else:
node.set('data-oe-id', str(view_id))
Expand Down

0 comments on commit d3557de

Please sign in to comment.