From 27a9c391970abd9e1d8f2fee73e6773bccaefe19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 30 May 2023 18:15:43 +0200 Subject: [PATCH] Set value on focus out and changed signal for datetime widget The focus out of child widgets must call focus out method. And we need to connect to the datetime-changed event as DateTime does not call the __init__ method of Date. Closes #12020 --- tryton/tryton/gui/window/view_form/view/form_gtk/calendar_.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tryton/tryton/gui/window/view_form/view/form_gtk/calendar_.py b/tryton/tryton/gui/window/view_form/view/form_gtk/calendar_.py index 34bc67fc2a..86de75315b 100644 --- a/tryton/tryton/gui/window/view_form/view/form_gtk/calendar_.py +++ b/tryton/tryton/gui/window/view_form/view/form_gtk/calendar_.py @@ -138,6 +138,8 @@ class DateTime(Date): child.connect('key_press_event', self.sig_key_press) child.connect('activate', self.sig_activate) child.connect('changed', lambda _: self.send_modified()) + child.connect('focus-out-event', lambda *a: self._focus_out()) + self.entry.connect(self._changed_signal, self.changed) self.widget.pack_start(self.entry, expand=False, fill=False, padding=0) @classmethod