diff options
| author | Aaron Bohy <aab@odoo.com> | 2016-08-23 13:46:35 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2016-09-28 16:55:51 +0200 |
| commit | b1b80d8d6d4ff117a1835cd7617a8e48627e6c8c (patch) | |
| tree | 57a9b58a638fb787e9320a27e070bf4cc26cb8d5 /addons | |
| parent | aa19d9edd02756d87056a44340e36568b3183e21 (diff) | |
[IMP] web: add option replace_last_action to do_action in action_manager
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web/static/src/js/action_manager.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/addons/web/static/src/js/action_manager.js b/addons/web/static/src/js/action_manager.js index fe50fb65e90..4a03fadc543 100644 --- a/addons/web/static/src/js/action_manager.js +++ b/addons/web/static/src/js/action_manager.js @@ -269,11 +269,15 @@ var ActionManager = Widget.extend({ var old_action_stack = this.action_stack; var old_action = this.inner_action; var old_widget = this.inner_widget; + var actions_to_destroy; options = options || {}; - // Empty action_stack if requested + // Empty action_stack or replace last action if requested if (options.clear_breadcrumbs) { + actions_to_destroy = this.action_stack; this.action_stack = []; + } else if (options.replace_last_action && this.action_stack.length > 0) { + actions_to_destroy = [this.action_stack.pop()]; } // Instantiate the new action @@ -318,8 +322,8 @@ var ActionManager = Widget.extend({ in_DOM: self.is_in_DOM, callbacks: [{widget: self.inner_widget}], }); - if (options.clear_breadcrumbs) { - self.clear_action_stack(old_action_stack); + if (actions_to_destroy) { + self.clear_action_stack(actions_to_destroy); } self.toggle_fullscreen(); }).fail(function () { @@ -561,6 +565,7 @@ var ActionManager = Widget.extend({ do_action: function(action, options) { options = _.defaults(options || {}, { clear_breadcrumbs: false, + replace_last_action: false, on_reverse_breadcrumb: function() {}, hide_breadcrumb: false, on_close: function() {}, |
