diff options
| author | Christophe Simonis <chs@openerp.com> | 2011-12-13 11:41:00 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@openerp.com> | 2011-12-13 11:41:00 +0100 |
| commit | 3c9a0d91f0eb922611fcce74b41db27e82d79b5a (patch) | |
| tree | 2a242a319acf7207df0cb74c339e2e3e82a965df /addons/web/static/src | |
| parent | e28eaa509b928ca836322db3a3957edaf81345a6 (diff) | |
[FIX] cleanup do_load_state methods
bzr revid: chs@openerp.com-20111213104100-qxvyqnr84bm1x6x5
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views.js | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 0c0fc74514e..985a75a8030 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -54,18 +54,17 @@ session.web.ActionManager = session.web.Widget.extend({ do_load_state: function(state) { if (state.action_id) { - var run_action = (!this.inner_viewmanager) || this.inner_viewmanager.action.id !== state.action_id; - if (run_action) { - this.null_action(); - this.do_action(state.action_id); - } + this.null_action(); + this.do_action(state.action_id); + } + else if (state.model && state.id) { + // TODO implement it + //this.null_action(); + // action = {} } else if (state.client_action) { - var run_client = (!this.client_widget) || this.client_widget_name !== state.client_action.tag; - if (run_client) { - this.null_action(); - this.ir_actions_client(state.client_action); - } + this.null_action(); + this.ir_actions_client(state.client_action); } if (this.inner_viewmanager) { @@ -548,13 +547,8 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner }, do_load_state: function(state) { - var self = this, - defs = []; - if (state.view_type && state.view_type !== this.active_view) { - defs.push(this.on_mode_switch(state.view_type, true)); - } - - $.when(defs).then(function() { + var self = this; + $.when(this.on_mode_switch(state.view_type, true)).done(function() { self.views[self.active_view].controller.do_load_state(state); }); }, |
