changeset 3e6164964752 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset&node=3e6164964752
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
diffstat:
tryton/gui/window/win_form.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diffs (17 lines):
diff -r 3d33c402995f -r 3e6164964752 tryton/gui/window/win_form.py
--- a/tryton/gui/window/win_form.py Wed Apr 21 23:51:15 2021 +0200
+++ b/tryton/gui/window/win_form.py Thu Apr 22 00:07:18 2021 +0200
@@ -79,7 +79,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.ResponseType.CANCEL)
self.but_cancel.set_image(common.IconFactory.get_image(