Do not search remote value if view has no more the focus

If the user switch the tab with a value filled in the entry, the search window
is hidden and the all application is made insensitive. So we must ensure that
the search window will be linked to the current view. This is ensured by a
widget with the focus.

issue8733
review288291002
This commit is contained in:
Cédric Krier committed 2019-10-30 13:22:22 +01:00
1 parent 7ddb2ba096
commit 5b859cf3e0
1 file changed
+1 -1
@@ -695,7 +695,7 @@ class M2O(GenericText):
callback()
return
if model:
if model and common.get_toplevel_window().get_focus():
field = record[self.attrs['name']]
win = self.search_remote(record, field, text, callback=callback)
if len(win.screen.group) == 1: