From c8f907d5e5f7034a6f406676c31351087bb5f9ee Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Tue, 10 Aug 2010 19:04:18 +0530 Subject: [PATCH] [FIX]: base_calendar: Event with recurrence_uid is needed to be excluded in calendar view bzr revid: rpa@tinyerp.com-20100810133418-xp83r412mmhcwse6 --- addons/base_calendar/base_calendar.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 43aedb13777..15735f849ca 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -1251,9 +1251,10 @@ true, it will allow you to hide the event alarm information without removing it. else: ids = select result = [] + recur_dict = [] if ids and (base_start_date or base_until_date): cr.execute("select m.id, m.rrule, m.date, m.date_deadline, \ - m.exdate, m.exrule from " + self._table + \ + m.exdate, m.exrule, m.recurrent_id, m.recurrent_uid from " + self._table + \ " m where m.id in ("\ + ','.join(map(lambda x: str(x), ids))+")") @@ -1274,8 +1275,12 @@ true, it will allow you to hide the event alarm information without removing it. if until_date and (event_date > until_date): continue idval = real_id2base_calendar_id(data['id'], data['date']) - result.append(idval) - count += 1 + if not data['recurrent_id']: + result.append(idval) + count += 1 + else: + ex_id = real_id2base_calendar_id(data['recurrent_uid'], data['recurrent_id']) + recur_dict.append(ex_id) else: exdate = data['exdate'] and data['exdate'].split(',') or [] rrule_str = data['rrule'] @@ -1310,7 +1315,7 @@ true, it will allow you to hide the event alarm information without removing it. result.append(idval) count += 1 if result: - ids = result + ids = list(set(result)-set(recur_dict)) if isinstance(select, (str, int, long)): return ids and ids[0] or False return ids