Ensure to put search_value in URL

If the screen container or the domain parser are not yet ready to compute the
search_value, we should ensure to use the initial search_value. Otherwise sao
may trigger to open a new tab without the search_value because the URL will be
set with an empty search.

issue8267
review281471002
This commit is contained in:
Cédric Krier committed 2019-05-02 12:46:37 +02:00
1 parent 1e548d30e5
commit db18b3f033
1 file changed
+6 -2
+6 -2
View File
@@ -312,6 +312,7 @@ class Screen(SignalEvent):
domain = self.domain_parser.parse(search_string)
else:
domain = self.search_value
self.search_value = None
if set_text:
self.screen_container.set_text(
self.domain_parser.string(domain))
@@ -1215,8 +1216,11 @@ class Screen(SignalEvent):
path = [CONFIG['login.db'], 'model', self.model_name]
view_ids = [v.view_id for v in self.views] + self.view_ids
if self.current_view.view_type != 'form':
search_string = self.screen_container.get_text()
search_value = self.domain_parser.parse(search_string)
if self.search_value:
search_value = self.search_value
else:
search_string = self.screen_container.get_text()
search_value = self.domain_parser.parse(search_string)
if search_value:
query_string.append(('search_value', json.dumps(
search_value, cls=JSONEncoder,