From 12b6ee63e3c0af700dadff7f1d1a6598e7f168cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 9 Dec 2017 17:45:21 +0100 Subject: [PATCH] Catch the edition event of cell widgets to reset the M2O field value issue6875 review40771002 --- 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 88548938b2..4680aa8f8d 100644 --- a/tryton/gui/window/view_form/view/list_gtk/widget.py +++ b/tryton/gui/window/view_form/view/list_gtk/widget.py @@ -575,6 +575,10 @@ class M2O(GenericText): record, field = self._get_record_field(path) def changed(editable): + text = editable.get_text() + if field.get_client(record) != text: + field.set_client(record, (None, '')) + if field.get(record): stock1, tooltip1 = 'tryton-open', _("Open the record ") stock2, tooltip2 = 'tryton-clear', _("Clear the record ")