diff options
| author | Olivier Dony <odo@openerp.com> | 2014-05-28 17:45:31 +0200 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2014-05-28 17:45:31 +0200 |
| commit | e276ac33f614a97655e1b950abd71edae22e217a (patch) | |
| tree | a9516f2a2aef806bd99452b3ce10c4afe9c69f1d /addons/web/static/src/js/views.js | |
| parent | b4283f027175cf80f83d57a1585cc1a8a3ea3b34 (diff) | |
| parent | bf135ad05798abaff0acc87fc19092cde5fd5c36 (diff) | |
[MERGE] Forward-port saas-4 up to bf135ad
Diffstat (limited to 'addons/web/static/src/js/views.js')
| -rw-r--r-- | addons/web/static/src/js/views.js | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index c6e28301c42..ec233159d63 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -436,16 +436,6 @@ instance.web.ActionManager = instance.web.Widget.extend({ ir_actions_act_window: function (action, options) { var self = this; - if (action.target === 'current'){ - action.context['active_model'] = action.res_model; - if (action.res_id){ - action.context['active_id'] = action.res_id; - action.context['active_ids'] = [action.res_id]; - } else{ - delete action.context['active_id']; - delete action.context['active_ids']; - } - } return this.ir_actions_common({ widget: function () { return new instance.web.ViewManagerAction(self, action); }, action: action, @@ -895,7 +885,20 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({ this._super(parent, null, action.views, flags); this.session = parent.session; this.action = action; - var dataset = new instance.web.DataSetSearch(this, action.res_model, action.context, action.domain); + var context = action.context; + if (action.target === 'current'){ + var active_context = { + active_model: action.res_model, + }; + context = new instance.web.CompoundContext(context, active_context).eval(); + delete context['active_id']; + delete context['active_ids']; + if (action.res_id){ + context['active_id'] = action.res_id; + context['active_ids'] = [action.res_id]; + } + } + var dataset = new instance.web.DataSetSearch(this, action.res_model, context, action.domain); if (action.res_id) { dataset.ids.push(action.res_id); dataset.index = 0; |
