From 34751fe8d42aed3965ebfe07acaf0704068bf80f 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 (grafted from 62934f0e75525d65719bcc83f750d5e9070e4632) --HG-- branch : 6.0 --- 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 bbf8426453..fe9bf53bab 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 @@ -135,6 +135,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