changeset 3198a32f0263 in tryton:5.0
details: https://hg.tryton.org/tryton?cmd=changeset;node=3198a32f0263
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 5108e84f8f8e -r 3198a32f0263 tryton/gui/window/form.py
--- a/tryton/gui/window/form.py Wed Nov 11 15:53:58 2020 +0100
+++ b/tryton/gui/window/form.py Fri Dec 04 18:37:36 2020 +0100
@@ -508,7 +508,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