changeset 71937048060c in tryton:5.8
details: https://hg.tryton.org/tryton?cmd=changeset;node=71937048060c
description:
        Succeed when save modified is canceled on unique new record

        The reload does not set any current record so we can not compare ids.

        issue9936
        review314991002
        (grafted from 6cdea0d8ac5cb4e0012207c049f3b14addf0811d)
diffstat:

 tryton/gui/window/form.py |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (15 lines):

diff -r 0aeeaf77f6c6 -r 71937048060c tryton/gui/window/form.py
--- a/tryton/gui/window/form.py Fri Jan 01 16:11:14 2021 +0100
+++ b/tryton/gui/window/form.py Wed Dec 23 21:26:32 2020 +0100
@@ -555,7 +555,10 @@
             if value == 'ko':
                 record_id = self.screen.current_record.id
                 if self.sig_reload(test_modified=False):
-                    return record_id == self.screen.current_record.id
+                    if self.screen.current_record:
+                        return record_id == self.screen.current_record.id
+                    elif record_id < 0:
+                        return True
             return False
         return True
 

Reply via email to