[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.

note: 10.0 backport from 11.0 33aa89ed
closes #20405
opw-786866
closes #21792
This commit is contained in:
Nicolas Lempereur
2017-12-22 16:34:06 +01:00
parent 262bec6af5
commit 1ce4f15c39
@@ -385,6 +385,10 @@ var ActionManager = Widget.extend({
return this.inner_widget;
},
history_back: function() {
if (this.dialog) {
this.dialog_stop();
return;
}
var nb_views = this.inner_action.get_nb_views();
if (nb_views > 1) {
// Stay on this action, but select the previous view