[FIX] Action buttons does not include active_id in context when loading action
lp bug: https://launchpad.net/bugs/871771 fixed bzr revid: fme@openerp.com-20111018115040-66l0xiudl8yt8khq
This commit is contained in:
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user