From ad8a70c763fae708cd4b2ad57f8300cb1639294d Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 28 Sep 2011 11:35:53 +0200 Subject: [PATCH] [FIX] Context of actions loaded by buttons were not properly evaluated bzr revid: fme@openerp.com-20110928093553-571zsugcocpkk1hm --- addons/web/static/src/js/views.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index d31a3b05674..93265fdc5f1 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -775,14 +775,17 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{ var handler = function (r) { var action = r.result; if (action && action.constructor == Object) { - action.context = action.context || {}; - _.extend(action.context, { - active_id: record_id || false, - active_ids: [record_id || false], - active_model: dataset.model + 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 + }], + domains: [] + }, function (results) { + action.context = results.context + self.do_action(action, result_handler); }); - action.context = new db.web.CompoundContext(dataset.get_context(), action.context); - self.do_action(action, result_handler); } else { result_handler(); }