summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/framework
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2016-06-02 12:10:59 +0200
committerAaron Bohy <aab@odoo.com>2016-06-03 11:25:57 +0200
commit17461a57a0e628818fb8398013c21f2de8f58ce7 (patch)
treee6472270347d451515dacaff86519d21cff72db0 /addons/web/static/src/js/framework
parent9be5531f3e80ceb009d8f65abee22ec39010dc05 (diff)
[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.
Diffstat (limited to 'addons/web/static/src/js/framework')
-rw-r--r--addons/web/static/src/js/framework/data_manager.js4
1 files changed, 3 insertions, 1 deletions
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);
+ });
},
/**