Catch the edition event of cell widgets to reset the M2O field value

issue6875
review40771002
This commit is contained in:
Cédric Krier committed 2017-12-09 17:45:21 +01:00
1 parent a43989f403
commit 12b6ee63e3
1 file changed
+4
@@ -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 <F2>")
stock2, tooltip2 = 'tryton-clear', _("Clear the record <Del>")