From ecbd4323e8e8b34bbdd73f0524478914e76dd6ba Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Fri, 15 Oct 2010 12:56:52 +0300 Subject: [PATCH] base_calendar: convert libical timezones to plain format Timezones sent to us by libical contain their prefix and thus wouldn't match our preset list. Strip the prefix and try to match. bzr revid: p_christ@hol.gr-20101015095652-mey4elruff8fv1y3 --- addons/base_calendar/base_calendar.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index af111162312..577c053a1c9 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -1475,6 +1475,8 @@ true, it will allow you to hide the event alarm information without removing it. if not real_event_id in new_ids: new_ids.append(real_event_id) + if vals.get('vtimezone', '').startswith('/freeassociation.sourceforge.net/tzfile/'): + vals['vtimezone'] = vals['vtimezone'][40:] if new_ids: res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context) if (vals.has_key('alarm_id') or vals.has_key('base_calendar_alarm_id'))\ @@ -1604,6 +1606,8 @@ true, it will allow you to hide the event alarm information without removing it. """ if not context: context = {} + if vals.get('vtimezone', '').startswith('/freeassociation.sourceforge.net/tzfile/'): + vals['vtimezone'] = vals['vtimezone'][40:] res = super(calendar_event, self).create(cr, uid, vals, context) alarm_obj = self.pool.get('res.alarm') alarm_obj.do_alarm_create(cr, uid, [res], self._name, 'date', context=context)