From 7c8e468dee28aacd19c6a0a3299f7d8788caf09e Mon Sep 17 00:00:00 2001 From: Kersten Jeremy Date: Fri, 14 Mar 2014 17:56:41 +0100 Subject: [PATCH] [FIX] Convert offset aware into offset naive before to use timedelta. That remove traceback when we try to get notification (notif or mail) for a recurrent event bzr revid: jke@openerp.com-20140314165641-6bwyxe3wej4upqzh --- addons/calendar/calendar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index adb0ef784d5..3dc1fa75b8d 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -456,7 +456,7 @@ class calendar_alarm_manager(osv.AbstractModel): bFound = False LastFound = False for one_date in self.pool.get('calendar.event').get_recurrent_date_by_event(cr, uid, curEvent, context=context): - in_date_format = datetime.strptime(one_date, '%Y-%m-%d %H:%M:%S') + in_date_format = one_date.replace(tzinfo=None) LastFound = self.do_check_alarm_for_one_date(cr, uid, in_date_format, curEvent, max_delta, cron_interval, notif=False, context=context) if LastFound: for alert in LastFound: @@ -490,7 +490,7 @@ class calendar_alarm_manager(osv.AbstractModel): bFound = False LastFound = False for one_date in self.pool.get("calendar.event").get_recurrent_date_by_event(cr, uid, curEvent, context=context): - in_date_format = datetime.strptime(one_date, '%Y-%m-%d %H:%M:%S') + in_date_format = one_date.replace(tzinfo=None) LastFound = self.do_check_alarm_for_one_date(cr, uid, in_date_format, curEvent, max_delta, ajax_check_every_seconds, after=partner.calendar_last_notif_ack, mail=False, context=context) if LastFound: for alert in LastFound: