Return false when modified is not saved and not created

The return of modified_save method is used to decide to execute an action or
not. When a new record is cancelled, the client select the previous record so
we must not run the action on this one.

issue9881
review337111002
This commit is contained in:
Cédric Krier
2020-12-04 18:37:36 +01:00
parent 5e7cfa239c
commit 1ca1c35fc8
+7 -1
View File
@@ -734,7 +734,13 @@
case 'ok':
return this.save();
case 'ko':
return this.reload(false);
var record_id = this.screen.current_record.id;
return this.reload(false).then(function() {
if (record_id !=
this.screen.current_record.id) {
return jQuery.Deferred().reject();
}
}.bind(this));
default:
return jQuery.Deferred().reject();
}