changeset 941b90300b84 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset&node=941b90300b84
description:
Close tab when cancelling save on new record
issue10480
review363421002
diffstat:
tryton/gui/window/form.py | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (26 lines):
diff -r 2c23b9455702 -r 941b90300b84 tryton/gui/window/form.py
--- a/tryton/gui/window/form.py Sun Sep 05 14:41:46 2021 +0200
+++ b/tryton/gui/window/form.py Fri Sep 10 19:37:47 2021 +0200
@@ -667,17 +667,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():