diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-07-14 15:51:59 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-07-14 15:51:59 +0200 |
| commit | db2f82d5f1a8c4fdbbd61a0aa7daef2def0ef06e (patch) | |
| tree | 4dd6a0d816180b06963a245d01a817ebcdaf7868 /addons/web/static/src/js/chrome/action_manager.js | |
| parent | 55d72e1ab4a64f52e040911a8b4b4c8ce9443f65 (diff) | |
| parent | 4ca3d9cadf9607c95880bb5222041bced7b13ec0 (diff) | |
[MERGE] forward port branch saas-16 up to 4ca3d9cadf9
Diffstat (limited to 'addons/web/static/src/js/chrome/action_manager.js')
| -rw-r--r-- | addons/web/static/src/js/chrome/action_manager.js | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/addons/web/static/src/js/chrome/action_manager.js b/addons/web/static/src/js/chrome/action_manager.js index 280a90cec8d..5d4a44ba420 100644 --- a/addons/web/static/src/js/chrome/action_manager.js +++ b/addons/web/static/src/js/chrome/action_manager.js @@ -420,16 +420,20 @@ var ActionManager = Widget.extend({ return this.inner_widget; }, history_back: function() { - var nb_views = this.inner_action.get_nb_views(); - if (nb_views > 1) { + var nbViews = this.inner_action.get_nb_views(); + if (nbViews > 1) { // Stay on this action, but select the previous view - return this.select_action(this.inner_action, nb_views - 2); + return this.select_action(this.inner_action, nbViews - 2); } - if (this.action_stack.length > 1) { + var nbActions = this.action_stack.length; + if (nbActions > 1) { // Select the previous action - var action = this.action_stack[this.action_stack.length - 2]; - nb_views = action.get_nb_views(); - return this.select_action(action, nb_views - 1); + var action = this.action_stack[nbActions - 2]; + nbViews = action.get_nb_views(); + return this.select_action(action, nbViews - 1); + } + else if (nbActions === 1 && nbViews === 1) { + return this.select_action(this.action_stack[0], 0); } return $.Deferred().reject(); }, |
