[FIX] calendar: set context if none

Avoid traceback if no context in get_recurrent_date_by_event when code do:
    context.get('xx')
This commit is contained in:
Jeremy Kersten 2015-05-11 10:40:19 +02:00
parent e7886c6d75
commit 2e49fc09ff
1 changed files with 3 additions and 0 deletions

View File

@ -701,6 +701,9 @@ class calendar_event(osv.Model):
val = pytz.UTC.localize(val)
return val.astimezone(timezone)
if context is None:
context = {}
timezone = pytz.timezone(context.get('tz') or 'UTC')
startdate = pytz.UTC.localize(datetime.strptime(event.start, DEFAULT_SERVER_DATETIME_FORMAT)) # Add "+hh:mm" timezone
if not startdate: