changeset f813fb56a83d in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=f813fb56a83d
description:
Keep record added/modified after cancel from popup window
We need to keep the record modified to ensure that it is added to the
xxx2Many
on save.
issue9298
review296601002
diffstat:
tryton/gui/window/win_form.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diffs (20 lines):
diff -r c1f77d93195b -r f813fb56a83d tryton/gui/window/win_form.py
--- a/tryton/gui/window/win_form.py Sat Oct 24 13:12:01 2020 +0200
+++ b/tryton/gui/window/win_form.py Sat Oct 24 13:14:55 2020 +0200
@@ -404,6 +404,7 @@
if (self.screen.current_record
and not readonly
and response_id in cancel_responses):
+ added = 'id' in self.screen.current_record.modified_fields
if (self.screen.current_record.id < 0
or self.save_current):
self.screen.cancel_current(self._initial_value)
@@ -411,6 +412,8 @@
self.screen.current_record.cancel()
self.screen.current_record.reload()
self.screen.current_record.signal('record-changed')
+ if added:
+ self.screen.current_record.modified_fields.setdefault('id')
result = False
else:
result = response_id not in cancel_responses