From 028e2af772066010626d21c8d650b4fca01c7f3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 23 Oct 2015 23:50:18 +0200 Subject: [PATCH] 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 --- tryton/gui/window/view_form/view/list_gtk/widget.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tryton/gui/window/view_form/view/list_gtk/widget.py b/tryton/gui/window/view_form/view/list_gtk/widget.py index 4ab28e59e4..94606c833c 100644 --- a/tryton/gui/window/view_form/view/list_gtk/widget.py +++ b/tryton/gui/window/view_form/view/list_gtk/widget.py @@ -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):