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
This commit is contained in:
Cédric Krier
2020-01-20 11:10:51 +01:00
parent fac74df68b
commit 3378ee4674
2 changed files with 7 additions and 5 deletions
+4 -4
View File
@@ -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')))
+3 -1
View File
@@ -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)