diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 32e17db641f..4094d1019bb 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -854,15 +854,19 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{ return self.widget_parent.on_action_executed.apply(null, arguments); } }; + var context = new db.web.CompoundContext(dataset.get_context()); + if (record_id) { + context.add({ + active_id: record_id, + active_ids: [record_id], + active_model: dataset.model + }); + } var handler = function (r) { var action = r.result; if (action && action.constructor == Object) { return self.rpc('/web/session/eval_domain_and_context', { - contexts: [dataset.get_context(), action.context || {}, { - active_id: record_id || false, - active_ids: [record_id || false], - active_model: dataset.model - }], + contexts: [context, action.context || {}], domains: [] }).pipe(function (results) { if (!action_data.context) { @@ -878,8 +882,6 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{ } }; - var context = new db.web.CompoundContext(dataset.get_context(), action_data.context || {}); - if (action_data.special) { return handler({result: {"type":"ir.actions.act_window_close"}}); } else if (action_data.type=="object") {