From 17461a57a0e628818fb8398013c21f2de8f58ce7 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 2 Jun 2016 12:10:59 +0200 Subject: [FIX] web: data_manager: load_action: return deep copy of action The action object, and in particular its context, is modified by the Action Manager and by some views (e.g. sales_team_dashboard Kanban). So, as the action is stored in cache, the same object was returned each time the action was requested, and previous modifications of its context still applied. This produced a bug with the sales_team_dashboard when following those steps: - click on the link to today's activities, it opens an action with 'search_default_today' in the context, - come back to the dashboard - click on the link to this week's activities, it opens an action with 'search_default_this_week' in the context, but the formerly added key 'search_default_today' is still there as well, so the domain is wrong. --- addons/web/static/src/js/framework/data_manager.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/framework/data_manager.js') diff --git a/addons/web/static/src/js/framework/data_manager.js b/addons/web/static/src/js/framework/data_manager.js index 73521e1a06d..29d6d585f6a 100644 --- a/addons/web/static/src/js/framework/data_manager.js +++ b/addons/web/static/src/js/framework/data_manager.js @@ -39,7 +39,9 @@ return core.Class.extend({ }, this._invalidate.bind(this, this._cache.actions, key)); } - return this._cache.actions[key]; + return this._cache.actions[key].then(function (action) { + return $.extend(true, {}, action); + }); }, /** -- cgit v1.2.3