changeset c7477c90e6be in tryton:5.0
details: https://hg.tryton.org/tryton?cmd=changeset&node=c7477c90e6be
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 48514d572d18 -r c7477c90e6be 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
@@ -510,17 +510,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):
         action = action.copy()

Reply via email to