changeset 392c4a9f154c in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=392c4a9f154c
description:
        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
diffstat:

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

diffs (14 lines):

diff -r b16f02bdb345 -r 392c4a9f154c tryton/gui/window/form.py
--- a/tryton/gui/window/form.py Sun Nov 15 18:50:47 2020 +0100
+++ b/tryton/gui/window/form.py Fri Dec 04 18:37:36 2020 +0100
@@ -553,7 +553,9 @@
             if value == 'ok':
                 return self.sig_save(None)
             if value == 'ko':
-                return self.sig_reload(test_modified=False)
+                record_id = self.screen.current_record.id
+                if self.sig_reload(test_modified=False):
+                    return record_id == self.screen.current_record.id
             return False
         return True
 

Reply via email to