changeset 5b4d41c301a3 in tryton:5.8
details: https://hg.tryton.org/tryton?cmd=changeset;node=5b4d41c301a3
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 3f8fa1436ec3 -r 5b4d41c301a3 tryton/gui/window/form.py
--- a/tryton/gui/window/form.py Fri Dec 11 15:44:04 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