[FIX] don't break when an attribute node in an xpath makes the

expression not match the node any more. Fixes #885
pull/2494/head
Holger Brunn 2017-10-11 04:51:35 +02:00 committed by Enric Tobella
parent 2d4ba31965
commit 135b9f2fa7
3 changed files with 8 additions and 1 deletions

View File

@ -3,7 +3,7 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": "Extended view inheritance",
"version": "10.0.1.0.0",
"version": "10.0.1.0.1",
"author": "Therp BV,Odoo Community Association (OCA)",
"license": "LGPL-3",
"category": "Hidden/Dependency",

View File

@ -11,6 +11,10 @@
<attribute name="context" operation="python_dict" key="default_name">'The company name'</attribute>
<attribute name="context" operation="python_dict" key="default_company_id">context.get('company_id', context.get('company'))</attribute>
</field>
<!-- without operations, the standard handler should be called /-->
<field name="parent_id" position="attributes">
<attribute name="name">parent_id</attribute>
</field>
<form position="inside">
<notebook>
<page string="Phone numbers" name="phone_book" />

View File

@ -55,6 +55,9 @@ class IrUiView(models.Model):
yield node, handler
return
if spec.get('position') == 'attributes':
if all(not c.get('operation') for c in spec):
yield spec, self._get_inheritance_handler(spec)
return
for child in spec:
node = etree.Element(spec.tag, **spec.attrib)
node.insert(0, child)