From 0cc45c94545d4ef49955576b4cef1e410eaf32b4 Mon Sep 17 00:00:00 2001 From: "Kuldeep Joshi (OpenERP)" Date: Fri, 23 Dec 2011 15:13:43 +0530 Subject: [PATCH 1/3] [FIX] base_calendar: unlink the attendee of event lp bug: https://launchpad.net/bugs/907664 fixed bzr revid: kjo@tinyerp.com-20111223094343-9wfdhflsnsxqbqky --- 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 265c3bb93e6..ca13a909007 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -1498,6 +1498,10 @@ rule or repeating pattern of time to exclude from the recurring rule."), exdate = (data['exdate'] and (data['exdate'] + ',') or '') + date_new self.write(cr, uid, [real_event_id], {'exdate': exdate}) ids.remove(event_id) + for event in self.browse(cr, uid, ids, context=context): + if event.attendee_ids: + for attendee in event.attendee_ids: + self.pool.get('calendar.attendee').unlink(cr, uid, attendee.id, context=context) res = super(calendar_event, self).unlink(cr, uid, ids, context=context) self.pool.get('res.alarm').do_alarm_unlink(cr, uid, ids, self._name) From 2a954a8c908f02dce1f3e8809525a54570a84bc7 Mon Sep 17 00:00:00 2001 From: "Kuldeep Joshi (OpenERP)" Date: Fri, 23 Dec 2011 16:31:14 +0530 Subject: [PATCH 2/3] [FIX] base_calendar: improve the code bzr revid: kjo@tinyerp.com-20111223110114-66tiz3fbv6j3iqlp --- addons/base_calendar/base_calendar.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index ca13a909007..a633b65af0c 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -1486,6 +1486,7 @@ rule or repeating pattern of time to exclude from the recurring rule."), if not isinstance(ids, list): ids = [ids] res = False + calendar_obj=self.pool.get('calendar.attendee') for event_id in ids[:]: if len(str(event_id).split('-')) == 1: continue @@ -1500,8 +1501,8 @@ rule or repeating pattern of time to exclude from the recurring rule."), ids.remove(event_id) for event in self.browse(cr, uid, ids, context=context): if event.attendee_ids: - for attendee in event.attendee_ids: - self.pool.get('calendar.attendee').unlink(cr, uid, attendee.id, context=context) + attendee_ids = [x.id for x in event.attendee_ids] + calendar_obj.unlink(cr, uid, attendee_ids, context=context) res = super(calendar_event, self).unlink(cr, uid, ids, context=context) self.pool.get('res.alarm').do_alarm_unlink(cr, uid, ids, self._name) From 0cfde7d879850b64c3df99d663d6452577a6ffca Mon Sep 17 00:00:00 2001 From: "Kuldeep Joshi (OpenERP)" Date: Tue, 27 Dec 2011 16:14:01 +0530 Subject: [PATCH 3/3] [IMP] base_calendar: change the code of unlink of attendee bzr revid: kjo@tinyerp.com-20111227104401-3zfravs7purahc2z --- addons/base_calendar/base_calendar.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index a633b65af0c..c167fb8241d 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -1501,8 +1501,7 @@ rule or repeating pattern of time to exclude from the recurring rule."), ids.remove(event_id) for event in self.browse(cr, uid, ids, context=context): if event.attendee_ids: - attendee_ids = [x.id for x in event.attendee_ids] - calendar_obj.unlink(cr, uid, attendee_ids, context=context) + calendar_obj.unlink(cr, uid, [x.id for x in event.attendee_ids], context=context) res = super(calendar_event, self).unlink(cr, uid, ids, context=context) self.pool.get('res.alarm').do_alarm_unlink(cr, uid, ids, self._name)