changeset 70cdf0ef43d7 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=70cdf0ef43d7
description:
Remove id from screen context and compare proper attributes
As mode is not always filled, we must compare only if view_ids is empty
and we
must use the default value as fall-back.
The limit is a local parameter that should not be forced when opening
an URL.
The screen context may be modified thanks to the context model, we must
compare
the current context of the screen instead of the initial one.
issue8977
review272751003
diffstat:
tryton/gui/window/form.py | 8 ++++----
tryton/gui/window/view_form/screen/screen.py | 4 +++-
2 files changed, 7 insertions(+), 5 deletions(-)
diffs (33 lines):
diff -r 5588f4742fb0 -r 70cdf0ef43d7 tryton/gui/window/form.py
--- a/tryton/gui/window/form.py Thu Jan 09 22:35:55 2020 +0100
+++ b/tryton/gui/window/form.py Mon Jan 20 11:10:51 2020 +0100
@@ -91,11 +91,11 @@
return (self.model == model
and self.res_id == attributes.get('res_id')
and self.attributes.get('domain') == attributes.get('domain')
- and (self.attributes.get('mode') or []) == (
- attributes.get('mode') or [])
and self.attributes.get('view_ids') == attributes.get('view_ids')
- and self.attributes.get('context') == attributes.get('context')
- and self.attributes.get('limit') == attributes.get('limit')
+ and (attributes.get('view_ids')
+ or (self.attributes.get('mode') or ['tree', 'form']) == (
+ attributes.get('mode') or ['tree', 'form']))
+ and self.screen.local_context == attributes.get('context')
and self.attributes.get('search_value') == (
attributes.get('search_value')))
diff -r 5588f4742fb0 -r 70cdf0ef43d7
tryton/gui/window/view_form/screen/screen.py
--- a/tryton/gui/window/view_form/screen/screen.py Thu Jan 09 22:35:55
2020 +0100
+++ b/tryton/gui/window/view_form/screen/screen.py Mon Jan 20 11:10:51
2020 +0100
@@ -257,7 +257,9 @@
self.context_screen.display(set_cursor=True)
return False
context = self.local_context
- context.update(self.context_screen.get_on_change_value())
+ screen_context = self.context_screen.get_on_change_value()
+ screen_context.pop('id')
+ context.update(screen_context)
self.new_group(context)
domain = self.search_domain(search_string, True)