changeset 843f49dfc8cc in tryton:5.0 details: https://hg.tryton.org/tryton?cmd=changeset;node=843f49dfc8cc 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 (grafted from f813fb56a83d7d7a5a116722d6783b706fd7e55e) diffstat: tryton/gui/window/win_form.py | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diffs (20 lines): diff -r 3be991ebe900 -r 843f49dfc8cc 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 @@ -402,6 +402,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) @@ -409,6 +410,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