diff options
| author | Aaron Bohy <aab@odoo.com> | 2019-03-14 20:15:13 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2019-03-15 07:35:21 +0000 |
| commit | 9a8f59a674c8e545cdf653e6144dad565db86da3 (patch) | |
| tree | 0306040d8ef2312ea0c0316f0a1ae42890e0c9d4 /addons/web/static/src/js/views/abstract_controller.js | |
| parent | b9da1755747c6fc791ae81d04e79fb3ae7642c64 (diff) | |
[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 <VincentSchippefilt@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/src/js/views/abstract_controller.js')
| -rw-r--r-- | addons/web/static/src/js/views/abstract_controller.js | 5 |
1 files changed, 4 insertions, 1 deletions
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 |
