changeset 132df53d9f62 in tryton:5.0
details: https://hg.tryton.org/tryton?cmd=changeset&node=132df53d9f62
description:
Use change value as initial value for Window Form
The parent field must stay as eval value as it is not reset.
issue10185
review365111002
(grafted from 3e61649647523a6199f46e355b071c5c80c5b0e5)
diffstat:
tryton/gui/window/win_form.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diffs (17 lines):
diff -r 66594bba998b -r 132df53d9f62 tryton/gui/window/win_form.py
--- a/tryton/gui/window/win_form.py Wed May 05 22:44:12 2021 +0200
+++ b/tryton/gui/window/win_form.py Thu Apr 22 00:07:18 2021 +0200
@@ -69,7 +69,12 @@
label, icon = _("Delete"), 'tryton-delete'
else:
label, icon = _("Cancel"), 'tryton-cancel'
- self._initial_value = self.screen.current_record.get_eval()
+ record = self.screen.current_record
+ self._initial_value = record.get_on_change_value()
+ if record.parent and record.parent_name in record.group.fields:
+ parent_field = record.group.fields[record.parent_name]
+ self._initial_value[record.parent_name] = (
+ parent_field.get_eval(record))
self.but_cancel = self.win.add_button(
set_underline(label), gtk.RESPONSE_CANCEL)
self.but_cancel.set_image(common.IconFactory.get_image(