From 9c4b52000fbe24c138fe8aec7b472da7a792f1d5 Mon Sep 17 00:00:00 2001 From: Julien Castiaux Date: Fri, 26 Apr 2019 12:37:34 +0000 Subject: [PATCH] [FIX] calendar: browse record using IrRules Install CRM (we need the "Hide Private Message" record rule defined by that module), create a meeting as of today, set a reminder of one day, invite another user (Demo) as attendee, save. Edit, go to the options, change the "Show time as" to "free", save => access error due to the said record rule. Using a search instead of browse ensures record unavailable due to a record rule are filtered. Same as 54e970e opw-1974599 closes odoo/odoo#32987 Signed-off-by: Julien Castiaux --- addons/calendar/models/calendar.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/calendar/models/calendar.py b/addons/calendar/models/calendar.py index 677afec01c0..74bce265ae2 100644 --- a/addons/calendar/models/calendar.py +++ b/addons/calendar/models/calendar.py @@ -409,9 +409,8 @@ class AlarmManager(models.AbstractModel): all_meetings = self.get_next_potential_limit_alarm('notification', partner_id=partner.id) time_limit = 3600 * 24 # return alarms of the next 24 hours - for event_id in all_meetings: - max_delta = all_meetings[event_id]['max_duration'] - meeting = self.env['calendar.event'].browse(event_id) + for meeting in self.env['calendar.event'].search([('id', 'in', list(all_meetings))]): # cannot browse + max_delta = all_meetings[meeting.id]['max_duration'] if meeting.recurrency: b_found = False last_found = False