From c274a393333246c6ffb01ceaa300857036da0e93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 24 Sep 2012 16:27:15 +0200 Subject: [PATCH] Reset text widget of Many2One when search is cancelled This prevents to have enter event trigger an new search windows. --- tryton/gui/window/view_form/view/form_gtk/many2one.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tryton/gui/window/view_form/view/form_gtk/many2one.py b/tryton/gui/window/view_form/view/form_gtk/many2one.py index fbeebaa53f..a5fc0d20c3 100644 --- a/tryton/gui/window/view_form/view/form_gtk/many2one.py +++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py @@ -171,6 +171,8 @@ class Many2One(WidgetInterface): if result: self.field.set_client(self.record, self.value_from_id(*result[0]), force_change=True) + else: + self.wid_text.set_text('') self.focus_out = True self.changed = True