changeset e3a715ee875f in tryton:5.8
details: https://hg.tryton.org/tryton?cmd=changeset&node=e3a715ee875f
description:
Close tab when cancelling save on new record
issue10480
review363421002
(grafted from 941b90300b84c9116138ce8275e662e3dd792182)
diffstat:
tryton/gui/window/form.py | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (26 lines):
diff -r b68acf2ce753 -r e3a715ee875f tryton/gui/window/form.py
--- a/tryton/gui/window/form.py Thu Sep 02 23:12:06 2021 +0200
+++ b/tryton/gui/window/form.py Fri Sep 10 19:37:47 2021 +0200
@@ -555,17 +555,18 @@
if value == 'ko':
record_id = self.screen.current_record.id
if self.sig_reload(test_modified=False):
- if self.screen.current_record:
+ if record_id < 0:
+ return None
+ elif self.screen.current_record:
return record_id == self.screen.current_record.id
- elif record_id < 0:
- return True
return False
return True
def sig_close(self, widget=None):
for dialog in reversed(self.dialogs[:]):
dialog.destroy()
- return self.modified_save()
+ modified_save = self.modified_save()
+ return True if modified_save is None else modified_save
def _action(self, action, atype):
if not self.modified_save():