summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views.js
diff options
context:
space:
mode:
authorjke-openerp <jke@openerp.com>2013-12-20 15:51:33 +0100
committerjke-openerp <jke@openerp.com>2013-12-20 15:51:33 +0100
commit0bec0a3ef944436d9b1fa2ed2de16d2a4e0d3462 (patch)
tree7bfe44e8820555a82f56de913f5baea77a0d5445 /addons/web/static/src/js/views.js
parent698a74c0a2f4c2c7df3b6f1d268758ce4166b68d (diff)
parent1e3ebc028544f5e5c85191168630b3e11106e286 (diff)
[MERGE] Merge with trunk
bzr revid: jke@openerp.com-20131220145133-rgipx3bsh79isnxg
Diffstat (limited to 'addons/web/static/src/js/views.js')
-rw-r--r--addons/web/static/src/js/views.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js
index 37369377bf1..25a424394bb 100644
--- a/addons/web/static/src/js/views.js
+++ b/addons/web/static/src/js/views.js
@@ -1386,25 +1386,25 @@ instance.web.View = instance.web.Widget.extend({
return self.getParent().on_action_executed.apply(null, arguments);
}
};
- var context = dataset.get_context();
- if (action_data.model !== dataset.model) {
- // filter out context keys that are specific to the action model.
- // Wrong default_ and search_default values will no give the expected views
- // Wrong group_by values will simply fail and forbid rendering of the destination view
- context = _.object(_.reject(_.pairs(context.eval()), function(pair) {
- return pair[0].match('^(?:(?:default_|search_default_).+|group_by|group_by_no_leaf)$') !== null;
- }));
- }
+ var context = new instance.web.CompoundContext(dataset.get_context(), action_data.context || {});
- context = new instance.web.CompoundContext(context, action_data.context || {});
+ // response handler
var handler = function (action) {
if (action && action.constructor == Object) {
- var ncontext = new instance.web.CompoundContext(context);
+ // filter out context keys that are specific to the current action.
+ // Wrong default_* and search_default_* values will no give the expected result
+ // Wrong group_by values will simply fail and forbid rendering of the destination view
+ var ncontext = new instance.web.CompoundContext(
+ _.object(_.reject(_.pairs(dataset.get_context().eval()), function(pair) {
+ return pair[0].match('^(?:(?:default_|search_default_).+|group_by|group_by_no_leaf|active_id|active_ids)$') !== null;
+ }))
+ );
+ ncontext.add(action_data.context || {});
+ ncontext.add({active_model: dataset.model});
if (record_id) {
ncontext.add({
active_id: record_id,
active_ids: [record_id],
- active_model: dataset.model
});
}
ncontext.add(action.context || {});