From ddf9924fadd913ae473f85dfbbe5d918fe9e3c1a Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Wed, 11 Oct 2017 04:51:35 +0200 Subject: [PATCH] [FIX] don't break when an attribute node in an xpath makes the expression not match the node any more. Fixes #885 --- base_view_inheritance_extension/__manifest__.py | 2 +- base_view_inheritance_extension/demo/ir_ui_view.xml | 4 ++++ base_view_inheritance_extension/models/ir_ui_view.py | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/base_view_inheritance_extension/__manifest__.py b/base_view_inheritance_extension/__manifest__.py index 9088c8430..79b3cc94c 100644 --- a/base_view_inheritance_extension/__manifest__.py +++ b/base_view_inheritance_extension/__manifest__.py @@ -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", diff --git a/base_view_inheritance_extension/demo/ir_ui_view.xml b/base_view_inheritance_extension/demo/ir_ui_view.xml index 96c6c7352..043960209 100644 --- a/base_view_inheritance_extension/demo/ir_ui_view.xml +++ b/base_view_inheritance_extension/demo/ir_ui_view.xml @@ -11,6 +11,10 @@ 'The company name' context.get('company_id', context.get('company')) + + + parent_id +
diff --git a/base_view_inheritance_extension/models/ir_ui_view.py b/base_view_inheritance_extension/models/ir_ui_view.py index 3c844ec77..ae5a00695 100644 --- a/base_view_inheritance_extension/models/ir_ui_view.py +++ b/base_view_inheritance_extension/models/ir_ui_view.py @@ -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)