diff options
| author | Martin Trigaux <mat@odoo.com> | 2017-04-20 14:05:21 +0200 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2017-05-23 16:42:49 +0200 |
| commit | fc2daaeaec7bc8d668b9401fcfb4decb3d0c6d3e (patch) | |
| tree | d5a96d66805ce2184494e7fb9d28ec3f6839d20e | |
| parent | 385de3911054c397fc6a7f7b2233ffad15d0c724 (diff) | |
[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
| -rw-r--r-- | odoo/addons/base/ir/ir_ui_view.py | 3 |
1 files changed, 2 insertions, 1 deletions
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) |
