From fc2daaeaec7bc8d668b9401fcfb4decb3d0c6d3e Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 20 Apr 2017 14:05:21 +0200 Subject: [PATCH] [FIX] base: include installed module in inheriting views retrival In a scenario with the following views: Mod A, view 1* |-- Mod B, view 2 \-- Mod B, view 3* view 3 can not rely on the elements added by view 2 in xpath If view 3 is a primary view, view 1 must be fully resolved first (apply view 2) before resolving view 3. Next commit describes a real use-case with product. Linked to #16541 and #16428 --- odoo/addons/base/ir/ir_ui_view.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/odoo/addons/base/ir/ir_ui_view.py b/odoo/addons/base/ir/ir_ui_view.py index 03bad9cce6d..55edfec992e 100644 --- a/odoo/addons/base/ir/ir_ui_view.py +++ b/odoo/addons/base/ir/ir_ui_view.py @@ -431,7 +431,8 @@ actual arch. # cannot currently use relationships that are # not required. The root cause is the INNER JOIN # used to implement it. - views = self.search(conditions + [('model_ids.module', 'in', tuple(self.pool._init_modules))]) + modules = tuple(self.pool._init_modules) + (self._context.get('install_mode_data', {}).get('module'),) + views = self.search(conditions + [('model_ids.module', 'in', modules)]) views = self.search(conditions + [('id', 'in', list(self._context.get('check_view_ids') or (0,)) + map(int, views))]) else: views = self.search(conditions)