diff options
| author | Mathieu Duckerts-Antoine <dam@odoo.com> | 2020-03-18 10:37:54 +0000 |
|---|---|---|
| committer | Mathieu Duckerts-Antoine <dam@odoo.com> | 2020-03-20 08:06:41 +0000 |
| commit | 1959e7756a341ab8b76920e194376b7e6af6cd91 (patch) | |
| tree | 0a4e468fd8634aca57bb749e1d9ef3f33e63e278 /addons/web/static/src | |
| parent | bc6dc53b6da17b22f66e744924cabb976e3f37e6 (diff) | |
[FIX] web: do not activate falsy search defaults
Before this commit, if an action context would contain a key/value pair
like
search_default_foo : 0
the filter foo would be activated, while it should be not considered
as default.
The present commit fixes that situation.
closes odoo/odoo#47958
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/control_panel/control_panel_model.js | 5 |
1 files changed, 4 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 8ffe53ced6f..93c9d225d9b 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 @@ -1676,7 +1676,10 @@ odoo.define('web.ControlPanelModel', function (require) { for (const key in this.actionContext) { const match = /^search_default_(.*)$/.exec(key); if (match) { - this.searchDefaults[match[1]] = this.actionContext[key]; + const val = this.actionContext[key]; + if (val) { + this.searchDefaults[match[1]] = val; + } delete this.actionContext[key]; } } |
