From 071d07beecef759936d544fbd99e57a949985492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 28 Sep 2018 17:33:46 +0200 Subject: [PATCH] Fix activate and value format of Times in filter issue7740 review64421002 --- tryton/gui/window/view_form/view/screen_container.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/screen_container.py b/tryton/gui/window/view_form/view/screen_container.py index 6af5fc0cc6..bdd4bba322 100644 --- a/tryton/gui/window/view_form/view/screen_container.py +++ b/tryton/gui/window/view_form/view/screen_container.py @@ -1,5 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. +import datetime + import gtk import gettext import gobject @@ -59,9 +61,14 @@ class Times(Dates): def __init__(self, format_, _entry=Time): super(Times, self).__init__(_entry=_entry) + def _get_value(self, widget): + value = widget.props.value + if value: + return datetime.time.strftime(value, widget.props.format) + def connect_activate(self, callback): for widget in self.from_.get_children() + self.to.get_children(): - widget.get_child().connect('activate', callback) + widget.connect('activate', callback) class DateTimes(Dates):