summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome/action_manager.js
diff options
context:
space:
mode:
authorKhoi Nguyen <bng@odoo.com>2017-09-29 14:54:48 +0200
committerKhoi Nguyen <khoi@nguyen.me.uk>2017-10-16 12:20:11 +0200
commitb6c3ee4e24ffefe6de326bb94861226c176a5bd9 (patch)
tree09e4c8d2eb1c3f80318d9fe67046d4831f966979 /addons/web/static/src/js/chrome/action_manager.js
parent8ee9024a4c888647df9e18861fe5e58b68947469 (diff)
[FIX] web: discarding a new record in a modal closes the modal
Discarding a new record triggers the 'history_back' action. This makes sense if the record was discarded from a normal form view, but not so much when in a modal, where the expected behaviour is to close the dialog. This commit overrides the function in the action manager which handles the switch to the previous view. It checks whether a dialog window is open, in which case it simply closes it.
Diffstat (limited to 'addons/web/static/src/js/chrome/action_manager.js')
-rw-r--r--addons/web/static/src/js/chrome/action_manager.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/web/static/src/js/chrome/action_manager.js b/addons/web/static/src/js/chrome/action_manager.js
index 8b88ee0c54f..aa5572f5e7d 100644
--- a/addons/web/static/src/js/chrome/action_manager.js
+++ b/addons/web/static/src/js/chrome/action_manager.js
@@ -420,6 +420,10 @@ var ActionManager = Widget.extend({
return this.inner_widget;
},
history_back: function() {
+ if (this.dialog) {
+ this.dialog.close();
+ return;
+ }
var nbViews = this.inner_action.get_nb_views();
if (nbViews > 1) {
// Stay on this action, but select the previous view