From b58937a4d5c5157991c5d2cff1f1dad7be8cfa34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 31 Aug 2016 23:00:05 +0200 Subject: [PATCH] Do not store in calendar invalid event The user could create an event with an end date before the start date during edition. So event must not be added to the store of GooCalendar because it does not support such inconsistency. issue5723 review33291002 --- tryton/gui/window/view_form/view/calendar_gtk/calendar_.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tryton/gui/window/view_form/view/calendar_gtk/calendar_.py b/tryton/gui/window/view_form/view/calendar_gtk/calendar_.py index 3a90ee5668..39a1315d0c 100644 --- a/tryton/gui/window/view_form/view/calendar_gtk/calendar_.py +++ b/tryton/gui/window/view_form/view/calendar_gtk/calendar_.py @@ -95,6 +95,10 @@ class Calendar_(goocalendar.Calendar): elif not end: all_day = True + # Skip invalid event + if end is not None and start > end: + continue + # TODO define color code label = '\n'.join(record[attrs['name']].get_client(record) for attrs in self.fields).rstrip()