diff options
| author | Aaron Bohy <aab@odoo.com> | 2016-07-07 09:25:14 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2016-07-12 15:30:01 +0200 |
| commit | ee4c808d2c393a91dde6628cd563047c10c8af57 (patch) | |
| tree | 5189eea0f2944ad633985e9d2bd19059e8474316 /addons/web/static/src/js/widgets/debug_manager.js | |
| parent | 78fa186f887f57a287150e4d435e55e76d4c8553 (diff) | |
[FIX] web: debug_manager: update when coming back with breadcrumbs
Before this rev., the debug manager's state was only updated when pushing a new
action but not when coming back to a previous action using the breadcrumbs.
So when the latter case happened, the debug manager was desynchronized with the
action manager and it allowed to edit an action that wasn't the current action.
Diffstat (limited to 'addons/web/static/src/js/widgets/debug_manager.js')
| -rw-r--r-- | addons/web/static/src/js/widgets/debug_manager.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/addons/web/static/src/js/widgets/debug_manager.js b/addons/web/static/src/js/widgets/debug_manager.js index 0106bf55626..8d868ef2ea1 100644 --- a/addons/web/static/src/js/widgets/debug_manager.js +++ b/addons/web/static/src/js/widgets/debug_manager.js @@ -49,7 +49,7 @@ var DebugManager = Widget.extend({ } }, start: function () { - core.bus.on('action_pushed', this, this.update); + core.bus.on('current_action_updated', this, this.update.bind(this, 'action')); core.bus.on('rpc:result', this, function (req, resp) { this._debug_events(resp.debug); }); @@ -666,12 +666,20 @@ if (core.debug) { start: function() { var self = this; return this._super().then(function () { - // Override push_action so that it triggers an event each time a new action is pushed + // Override push_action and select_action so that it triggers + // an event each time a new action is pushed. // The DebugManager listens to this event to keep itself up-to-date var push_action = self.action_manager.push_action; self.action_manager.push_action = function(widget, descr) { return push_action.apply(self.action_manager, arguments).then(function () { - core.bus.trigger('action_pushed', 'action', descr, widget); + core.bus.trigger('current_action_updated', descr, widget); + }); + }; + var select_action = self.action_manager.select_action; + self.action_manager.select_action = function() { + return select_action.apply(self.action_manager, arguments).then(function () { + var action = self.action_manager.get_inner_action(); + core.bus.trigger('current_action_updated', action.action_descr, action.widget); }); }; }); |
