From 3109a05d57f16882d8d8dd22e643b3b28aed2314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 22 Feb 2016 23:20:54 +0100 Subject: [PATCH] Support DateTime widget in add_operators The filter box is already using this way but the changeset d1af53492682 make it fails because the DateTime doesn't have get_editable method. issue5338 review20741002 --- tryton/common/datetime_.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tryton/common/datetime_.py b/tryton/common/datetime_.py index 55285ff344..3217def348 100644 --- a/tryton/common/datetime_.py +++ b/tryton/common/datetime_.py @@ -525,6 +525,10 @@ def add_operators(widget): return True return False + if isinstance(widget, DateTime): + for child in widget.get_children(): + add_operators(child) + return widget if isinstance(widget, gtk.ComboBoxEntry): editable = widget.get_child() else: @@ -569,8 +573,7 @@ if __name__ == '__main__': t.show() v.pack_start(t, False, False) - dt = DateTime() - [add_operators(c) for c in dt.get_children()] + dt = add_operators(DateTime()) dt.show() v.pack_start(dt, False, False)