changeset 6c153ebf5927 in sao:5.6
details: https://hg.tryton.org/sao?cmd=changeset;node=6c153ebf5927
description:
        Keep record added/modified after cancel from popup window

        We need to keep the record modified to ensure that it is added to the 
xxx2Many
        on save.

        issue9298
        review296601002
        (grafted from e474e7cddb63b3c592b51ae638c076239b725808)
diffstat:

 src/window.js |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (21 lines):

diff -r 5a25cfb55277 -r 6c153ebf5927 src/window.js
--- a/src/window.js     Sat Oct 24 13:12:01 2020 +0200
+++ b/src/window.js     Sat Oct 24 13:14:55 2020 +0200
@@ -404,6 +404,7 @@
                     !readonly &&
                     this.screen.current_record) {
                 result = false;
+                var added = this.screen.current_record._changed.id;
                 if ((this.screen.current_record.id < 0) || this.save_current) {
                     cancel_prm = this.screen.cancel_current(
                         this._initial_value);
@@ -411,6 +412,9 @@
                     this.screen.current_record.cancel();
                     cancel_prm = this.screen.current_record.reload();
                 }
+                if (added) {
+                    this.screen.current_record._changed.id = added;
+                }
             } else {
                 result = response_id != 'RESPONSE_CANCEL';
             }

Reply via email to