[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
This commit is contained in:
parent
b9ff076c73
commit
7c8e468dee
|
@ -456,7 +456,7 @@ class calendar_alarm_manager(osv.AbstractModel):
|
||||||
bFound = False
|
bFound = False
|
||||||
LastFound = False
|
LastFound = False
|
||||||
for one_date in self.pool.get('calendar.event').get_recurrent_date_by_event(cr, uid, curEvent, context=context):
|
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)
|
LastFound = self.do_check_alarm_for_one_date(cr, uid, in_date_format, curEvent, max_delta, cron_interval, notif=False, context=context)
|
||||||
if LastFound:
|
if LastFound:
|
||||||
for alert in LastFound:
|
for alert in LastFound:
|
||||||
|
@ -490,7 +490,7 @@ class calendar_alarm_manager(osv.AbstractModel):
|
||||||
bFound = False
|
bFound = False
|
||||||
LastFound = False
|
LastFound = False
|
||||||
for one_date in self.pool.get("calendar.event").get_recurrent_date_by_event(cr, uid, curEvent, context=context):
|
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)
|
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:
|
if LastFound:
|
||||||
for alert in LastFound:
|
for alert in LastFound:
|
||||||
|
|
Loading…
Reference in New Issue