[FIX] base : context evaluation with active_id server side. It now keeps the active_id in case of a refresh.
This commit is contained in:
parent
4f3db3ec04
commit
1a9b9442ac
|
@ -1218,7 +1218,7 @@ class Binary(http.Controller):
|
|||
class Action(http.Controller):
|
||||
|
||||
@http.route('/web/action/load', type='json', auth="user")
|
||||
def load(self, action_id, do_not_eval=False):
|
||||
def load(self, action_id, do_not_eval=False, additional_context=None):
|
||||
Actions = request.session.model('ir.actions.actions')
|
||||
value = False
|
||||
try:
|
||||
|
@ -1233,11 +1233,12 @@ class Action(http.Controller):
|
|||
|
||||
base_action = Actions.read([action_id], ['type'], request.context)
|
||||
if base_action:
|
||||
ctx = {}
|
||||
ctx = request.context
|
||||
action_type = base_action[0]['type']
|
||||
if action_type == 'ir.actions.report.xml':
|
||||
ctx.update({'bin_size': True})
|
||||
ctx.update(request.context)
|
||||
if additional_context:
|
||||
ctx.update(additional_context)
|
||||
action = request.session.model(action_type).read([action_id], False, ctx)
|
||||
if action:
|
||||
value = clean_action(action[0])
|
||||
|
|
|
@ -339,7 +339,12 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
|||
return this.do_action(action_client, options);
|
||||
} else if (_.isNumber(action) || _.isString(action)) {
|
||||
var self = this;
|
||||
return self.rpc("/web/action/load", { action_id: action }).then(function(result) {
|
||||
var additional_context = {
|
||||
active_id : options.additional_context.active_id,
|
||||
active_ids : options.additional_context.active_ids,
|
||||
active_model : options.additional_context.active_model
|
||||
};
|
||||
return self.rpc("/web/action/load", { action_id: action, additional_context : additional_context }).then(function(result) {
|
||||
return self.do_action(result, options);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue