summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/action_manager.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2016-02-26 11:18:40 +0100
committerGéry Debongnie <ged@odoo.com>2016-03-09 13:01:34 +0100
commit8a47095a609f190890a8be06fb4656f13b43c5e9 (patch)
tree6dc4b5e62111a83eadcca71dcc6d5f42b087e88a /addons/web/static/src/js/action_manager.js
parenta82413fb7a04cd8144c413ea4ab3be5d05e82559 (diff)
[REF] web: view_manager's init
Always initialize a view_manager with its dataset and views, but without the action (at least explicitely, as the action might still be given within the options). This is a backport of changes in enterprise to keep the view_manager's API similar in both repository, which is required the large refactoring that will arrive.
Diffstat (limited to 'addons/web/static/src/js/action_manager.js')
-rw-r--r--addons/web/static/src/js/action_manager.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/addons/web/static/src/js/action_manager.js b/addons/web/static/src/js/action_manager.js
index 5eb5aaa9891..be7f9fa93d6 100644
--- a/addons/web/static/src/js/action_manager.js
+++ b/addons/web/static/src/js/action_manager.js
@@ -703,9 +703,23 @@ var ActionManager = Widget.extend({
},
ir_actions_act_window: function (action, options) {
var self = this;
+
+ var flags = action.flags || {};
+ if (!('auto_search' in flags)) {
+ flags.auto_search = action.auto_search !== false;
+ }
+ options.action = action;
+ options.action_manager = this;
+ var dataset = new data.DataSetSearch(this, action.res_model, action.context, action.domain);
+ if (action.res_id) {
+ dataset.ids.push(action.res_id);
+ dataset.index = 0;
+ }
+ var views = action.views;
+
return this.ir_actions_common({
widget: function () {
- return new ViewManager(self, null, null, null, action, options);
+ return new ViewManager(self, dataset, views, flags, options);
},
action: action,
klass: 'o_act_window',