From e509f9155b0ff12f96d93c820a5790cda6d93276 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 8 Sep 2015 17:15:49 +0200 Subject: [PATCH] [FIX] google_calendar: all day event stop date For an event during all day, during 2 days, e.g. September 9th and September 10th, Google expects as start date the first day, and as stop date the day after the last day. e.g. start 2015-09-09 stop 2015-09-11 Even if, afterwise, in the Google Agenda interface, it will be correctly displayed 2015-09-10 as end date. This must be applied at the event creation AND at the event update. It was not the case until this revision. Besides, we now use the event `stop_date` in Odoo, instead of the duration, in case the duration has been incorrectly computed. opw-648867 --- addons/google_calendar/google_calendar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/google_calendar/google_calendar.py b/addons/google_calendar/google_calendar.py index fb7dd0dfa6a..5a3ee71667c 100644 --- a/addons/google_calendar/google_calendar.py +++ b/addons/google_calendar/google_calendar.py @@ -206,7 +206,7 @@ class google_calendar(osv.AbstractModel): context = {} if event.allday: start_date = fields.datetime.context_timestamp(cr, uid, datetime.strptime(event.start, tools.DEFAULT_SERVER_DATETIME_FORMAT), context=context).isoformat('T').split('T')[0] - final_date = fields.datetime.context_timestamp(cr, uid, datetime.strptime(event.start, tools.DEFAULT_SERVER_DATETIME_FORMAT) + timedelta(hours=event.duration) + timedelta(days=isCreating and 1 or 0), context=context).isoformat('T').split('T')[0] + final_date = fields.datetime.context_timestamp(cr, uid, datetime.strptime(event.stop, tools.DEFAULT_SERVER_DATETIME_FORMAT) + timedelta(days=1), context=context).isoformat('T').split('T')[0] type = 'date' vstype = 'dateTime' else: