summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabien Meghazi <fme@openerp.com>2011-12-14 16:29:03 +0100
committerFabien Meghazi <fme@openerp.com>2011-12-14 16:29:03 +0100
commit72aa0f74cd6eea9dbfe01f41dc2f8a9b2a92be93 (patch)
treef177cbc3ddeba81e58d5e608770acaa82181d7a9
parentb6078569363e5d661e74905096f03f2e98bde68a (diff)
[IMP] Move flags to ViewManager level so it can be passed to its constructor
bzr revid: fme@openerp.com-20111214152903-7vzv503w3e1axtwh
-rw-r--r--addons/web/static/src/js/views.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js
index 0ad49f69f7b..fcc8a4cc06c 100644
--- a/addons/web/static/src/js/views.js
+++ b/addons/web/static/src/js/views.js
@@ -200,7 +200,7 @@ session.web.ViewManager = session.web.Widget.extend(/** @lends session.web.View
* @param dataset
* @param views
*/
- init: function(parent, dataset, views) {
+ init: function(parent, dataset, views, flags) {
this._super(parent);
this.model = dataset ? dataset.model : undefined;
this.dataset = dataset;
@@ -208,7 +208,7 @@ session.web.ViewManager = session.web.Widget.extend(/** @lends session.web.View
this.active_view = null;
this.views_src = _.map(views, function(x) {return x instanceof Array? {view_id: x[0], view_type: x[1]} : x;});
this.views = {};
- this.flags = this.flags || {};
+ this.flags = flags || {};
this.registry = session.web.views;
this.views_history = [];
},
@@ -415,19 +415,10 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
// dataset initialization will take the session from ``this``, so if we
// do not have it yet (and we don't, because we've not called our own
// ``_super()``) rpc requests will blow up.
- this._super(parent, null, action.views);
- this.session = parent.session;
- this.action = action;
- var dataset = new session.web.DataSetSearch(this, action.res_model, action.context, action.domain);
- if (action.res_id) {
- dataset.ids.push(action.res_id);
- dataset.index = 0;
- }
- this.dataset = dataset;
- this.flags = this.action.flags || {};
+ var flags = action.flags || {};
if (action.res_model == 'board.board' && action.view_mode === 'form') {
// Special case for Dashboards
- _.extend(this.flags, {
+ _.extend(flags, {
views_switcher : false,
display_title : false,
search_view : false,
@@ -436,6 +427,15 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
action_buttons : false
});
}
+ this._super(parent, null, action.views, flags);
+ this.session = parent.session;
+ this.action = action;
+ var dataset = new session.web.DataSetSearch(this, action.res_model, action.context, action.domain);
+ if (action.res_id) {
+ dataset.ids.push(action.res_id);
+ dataset.index = 0;
+ }
+ this.dataset = dataset;
// setup storage for session-wise menu hiding
if (this.session.hidden_menutips) {