[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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user