changeset f61d0053453b in tryton:5.0
details: https://hg.tryton.org/tryton?cmd=changeset;node=f61d0053453b
description:
Use group _context to avoid leaking session context
When launching a new action, the context should not contain the session
context because it is automatically appended to the evaluation.
When creating a new group when the context model changed, it should not
contain the session context neither.
issue8312
review267301002
(grafted from fc20ef244ecadfcfe5393bd8ece163ab1a5d337e)
diffstat:
tryton/gui/window/form.py | 2 +-
tryton/gui/window/view_form/screen/screen.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diffs (24 lines):
diff -r 15d848943ea4 -r f61d0053453b tryton/gui/window/form.py
--- a/tryton/gui/window/form.py Thu May 02 12:46:37 2019 +0200
+++ b/tryton/gui/window/form.py Thu May 02 12:49:12 2019 +0200
@@ -530,7 +530,7 @@
'id': record_id,
'ids': record_ids,
}
- Action._exec_action(action, data, self.screen.context)
+ Action._exec_action(action, data, self.screen.group._context.copy())
def activate_save(self):
self.buttons['save'].props.sensitive = self.screen.modified()
diff -r 15d848943ea4 -r f61d0053453b
tryton/gui/window/view_form/screen/screen.py
--- a/tryton/gui/window/view_form/screen/screen.py Thu May 02 12:46:37
2019 +0200
+++ b/tryton/gui/window/view_form/screen/screen.py Thu May 02 12:49:12
2019 +0200
@@ -256,7 +256,7 @@
self.clear()
self.context_screen.display(set_cursor=True)
return False
- context = self.context
+ context = self.group._context.copy()
context.update(self.context_screen.get_on_change_value())
self.new_group(context)