[FIX] base_calendar: improve the code
bzr revid: kjo@tinyerp.com-20111223110114-66tiz3fbv6j3iqlp
This commit is contained in:
parent
0cc45c9454
commit
2a954a8c90
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue