From 9a8f59a674c8e545cdf653e6144dad565db86da3 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 14 Mar 2019 20:15:13 +0000 Subject: [FIX] web: update domain when switching between views Let's assume the following scenario on an action with two multi records views (e.g. kanban and list). In the kanban view, activate a domain or groupby, switch to list view, remove the domain or groupby, switch back to kanban: the domain or groupby is still applied (even though it's no longer displayed in the search view). This is due to the jQuery update (ab56e637b7f9) and the use of native Promises (always async) instead of old jQuery 1.11 Deferreds (which where sync when already resolved). In the new version, the domain/context/groupby were added to the params a 'tick too late', so the view was updated without that information (and thus the old domain/context/groupby were kept). Issue reported on the jquery update pad. closes odoo/odoo#31859 Signed-off-by: VincentSchippefilt --- addons/web/static/src/js/views/abstract_controller.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/views/abstract_controller.js b/addons/web/static/src/js/views/abstract_controller.js index 965ce404a64..c7a80864a15 100644 --- a/addons/web/static/src/js/views/abstract_controller.js +++ b/addons/web/static/src/js/views/abstract_controller.js @@ -182,6 +182,7 @@ var AbstractController = mvc.Controller.extend(ActionMixin, { */ reload: function (params) { params = params || {}; + var self = this; var def; var controllerState = params.controllerState || {}; var cpState = controllerState.cpState; @@ -190,7 +191,9 @@ var AbstractController = mvc.Controller.extend(ActionMixin, { params = _.extend({}, params, searchQuery); }); } - return Promise.resolve(def).then(this.update.bind(this, params, {})); + return Promise.resolve(def).then(function () { + return self.update(params, {}); + }); }, /** * For views that require a pager, this method will be called to allow the -- cgit v1.2.3