summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorMathieu Duckerts-Antoine <dam@odoo.com>2019-08-03 19:16:40 +0000
committerMathieu Duckerts-Antoine <dam@odoo.com>2019-08-13 08:18:16 +0000
commit397e00f18161df7011745f5e517a4e8ba150e07a (patch)
tree0569da8945cabf46f539368dad64508c9cce6cee /addons/web/static/src
parentff70f9683fdcbb617a118bae4f1f626058a8525b (diff)
[FIX] web: toggle favorite correctly updates other filters status
When toggling a favorite filter, the options used by the active date filters/groupbys and the field created via autocompletion were not correctly cleared, leading to strange situations. This is fixed by this commit.
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/views/control_panel/control_panel_model.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/control_panel/control_panel_model.js b/addons/web/static/src/js/views/control_panel/control_panel_model.js
index 208f3b7ee19..836a4eceb59 100644
--- a/addons/web/static/src/js/views/control_panel/control_panel_model.js
+++ b/addons/web/static/src/js/views/control_panel/control_panel_model.js
@@ -409,7 +409,17 @@ var ControlPanelModel = mvc.Model.extend({
// we need to deactivate all groups when activating a favorite
if (filter.type === 'favorite') {
this.query.forEach(function (groupId) {
- self.groups[groupId].activeFilterIds = [];
+ const group = self.groups[groupId];
+ group.activeFilterIds.forEach(id => {
+ const filter = self.filters[id[0]];
+ if (filter.autoCompleteValues) {
+ filter.autoCompleteValues = [];
+ }
+ if (filter.currentOptionIds) {
+ filter.currentOptionIds.clear();
+ }
+ })
+ group.activeFilterIds = [];
});
this.query = [];
}