From 47f488a56496e874b93aeb1428978a98d238a4ef Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 21 Aug 2019 13:43:23 +0000 Subject: [PATCH] [FIX] calendar: recurrent event no longer working Creating a recurrent event was no longer displaying all recurring events in the calendar, only the base event. This is following odoo/odoo@9920f20e4c7753bc17bea71dea3a90f7de687196 closes odoo/odoo#35919 Signed-off-by: Denis Ledoux --- addons/calendar/models/calendar.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/addons/calendar/models/calendar.py b/addons/calendar/models/calendar.py index d4ebcc713b8..45125f8aab4 100644 --- a/addons/calendar/models/calendar.py +++ b/addons/calendar/models/calendar.py @@ -1656,7 +1656,22 @@ class Meeting(models.Model): for calendar_id, real_id in select: if not real_data.get(real_id): continue - res = real_data[real_id] + res = real_data[real_id].copy() + ls = calendar_id2real_id(calendar_id, with_date=res and res.get('duration', 0) > 0 and res.get('duration') or 1) + if not isinstance(ls, (str, int)) and len(ls) >= 2: + res['start'] = ls[1] + res['stop'] = ls[2] + + if res['allday']: + res['start_date'] = ls[1] + res['stop_date'] = ls[2] + else: + res['start_datetime'] = ls[1] + res['stop_datetime'] = ls[2] + + if 'display_time' in fields: + res['display_time'] = self._get_display_time(ls[1], ls[2], res['duration'], res['allday']) + res['id'] = calendar_id result.append(res)