changeset f5ff671d7905 in tryton:5.6
details: https://hg.tryton.org/tryton?cmd=changeset;node=f5ff671d7905
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
        (grafted from 392c4a9f154c8c7094d2dbadef53dec0b1ca2b01)
diffstat:

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

diffs (14 lines):

diff -r 956e836dc061 -r f5ff671d7905 tryton/gui/window/form.py
--- a/tryton/gui/window/form.py Fri Dec 11 15:44:43 2020 +0100
+++ b/tryton/gui/window/form.py Fri Dec 04 18:37:36 2020 +0100
@@ -524,7 +524,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