Block editing done handler on completion action in treeview

The completion action popup window which trigger the editing_done event for
which the handler also popup a window. This second window must be prevented as
we are still editing the first one.

issue5061
review22571002
This commit is contained in:
Cédric Krier committed 2015-10-23 23:50:18 +02:00
1 parent 4dc63af59f
commit 028e2af772
1 file changed
+4
@@ -666,14 +666,18 @@ class M2O(GenericText):
def _completion_action_activated(self, completion, index, path):
record, field = self._get_record_field(path)
entry = completion.get_entry()
entry.handler_block(entry.editing_done_id)
def callback():
entry.handler_unblock(entry.editing_done_id)
entry.set_text(field.get_client(record))
if index == 0:
self.open_remote(record, create=False, changed=True,
text=entry.get_text(), callback=callback)
elif index == 1:
self.open_remote(record, create=True, callback=callback)
else:
entry.handler_unblock(entry.editing_done_id)
class O2O(M2O):