diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 27b68003aa2..45a5c8d9f62 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -1559,12 +1559,12 @@ true, it will allow you to hide the event alarm information without removing it. continue event_id, date_new = event_id.split('-') event_id = [int(event_id)] - for record in self.read(cr, uid, event_id, ['date', 'rrule', 'exdate']): + for record in self.read(cr, uid, event_id, ['date', 'rrule', 'exdate'], context=context): if record['rrule']: # Remove one of the recurrent event date_new = time.strftime("%Y-%m-%d %H:%M:%S", \ time.strptime(date_new, "%Y%m%d%H%M%S")) - exdate = (record['exdate'] and (record['exdate'] + ',') or '') + ''.join((re.compile('\d')).findall(date_new)) + 'Z' + exdate = (record['exdate'] and (record['exdate'] + ',') or '') + ''.join((re.compile('\d')).findall(date_new)) res = self.write(cr, uid, event_id, {'exdate': exdate}) else: res = super(calendar_event, self).unlink(cr, uid, event_id) diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py index c60bccad036..6937248e828 100644 --- a/addons/caldav/calendar.py +++ b/addons/caldav/calendar.py @@ -276,6 +276,7 @@ class CalDAV(object): timezones = [] for data in datas: tzval = None + exfield = None vevent = ical.add(name) for field in self.__attribute__.keys(): map_field = self.ical_get(field, 'field') @@ -316,6 +317,8 @@ class CalDAV(object): ical = tz_obj.export_cal(cr, uid, None, \ data[map_field], ical, context=context) timezones.append(data[map_field]) + if exfield: + exfield.params['TZID'] = [tzval.title()] elif field == 'organizer' and data[map_field]: event_org = vevent.add('organizer') organizer_id = data[map_field][0] @@ -326,7 +329,10 @@ class CalDAV(object): elif data[map_field]: if map_type in ("char", "text"): if field in ('exdate'): - vevent.add(field).value = map(parser.parse, (data[map_field]).split(',')) + exfield = vevent.add(field) + if tzval: + exfield.params['TZID'] = [tzval.title()] + exfield.value = map(parser.parse, (data[map_field]).split(',')) else: vevent.add(field).value = tools.ustr(data[map_field]) elif map_type in ('datetime', 'date') and data[map_field]: