diff options
| author | Xavier ALT <xal@odoo.com> | 2020-06-10 23:57:42 +0000 |
|---|---|---|
| committer | Xavier ALT <xal@odoo.com> | 2020-06-25 15:01:29 +0000 |
| commit | 19033e804ec243c593c9549a3f0024fbf2230ab1 (patch) | |
| tree | 778c915c3604d3923a0681502f0d14de1b01d2ff /addons/web/static/src/js | |
| parent | 6162a0fee38b6776567a0a324783cbdce38f0f43 (diff) | |
[FIX] web: in search view, use modifiers to determine if filter is invisible
In search view, the "invisible" attribute can use complex expression,
and so we must rely on the "modifiers" attribute set by the ir.ui.view
post-processing to determine if a filter should be invisible or not.
For example, considering the context {'hide_myfilter': False}, the
following view:
```xml
<search>
...
<filter name="myfilter" string="My Filter" invisible="context.get('hide_myfilter')"/>
...
</search>
```
Will be returned as such by the server:
```xml
<search>
...
<filter name="myfilter" string="My Filter" invisible="context.get('hide_myfilter')"
modifiers="{"invisible": false}"/>
...
</search>
```
After this commit, the filter "myfilter" will correctly be shown.
OPW-2243639
closes odoo/odoo#53690
X-original-commit: 00969326e24dadd9b3f6e026789a1e575dd1c8dc
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Xavier ALT <xavieralt@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/control_panel/control_panel_model.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/control_panel/control_panel_model.js b/addons/web/static/src/js/control_panel/control_panel_model.js index e1eb9c8da1a..67b9c999f74 100644 --- a/addons/web/static/src/js/control_panel/control_panel_model.js +++ b/addons/web/static/src/js/control_panel/control_panel_model.js @@ -915,7 +915,7 @@ odoo.define('web.ControlPanelModel', function (require) { filter.isDefault = attrs.isDefault; } filter.description = attrs.string || attrs.help || attrs.name || attrs.domain || 'Ω'; - if (attrs.invisible) { + if (JSON.parse(attrs.modifiers || '{}').invisible) { filter.invisible = true; } switch (filter.type) { |
