From 3378ee4674608e4dcb0b771b364d4d1ce27b755b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 20 Jan 2020 11:10:51 +0100 Subject: [PATCH] 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 --- tryton/gui/window/form.py | 8 ++++---- tryton/gui/window/view_form/screen/screen.py | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tryton/gui/window/form.py b/tryton/gui/window/form.py index b6b90919ea..9fc81d3af6 100644 --- a/tryton/gui/window/form.py +++ b/tryton/gui/window/form.py @@ -91,11 +91,11 @@ class Form(SignalEvent, TabContent): 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 --git a/tryton/gui/window/view_form/screen/screen.py b/tryton/gui/window/view_form/screen/screen.py index 18ed43642c..0f26271b90 100644 --- a/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/gui/window/view_form/screen/screen.py @@ -257,7 +257,9 @@ class Screen(SignalEvent): 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)