[FIX] calendar: Fix ir.cron access error on calendar.event

Problem
-------
Writing on a calendar.event trigger _setup_alarms that may need
to read on an ir.cron depending on the alarm setup.

Non admin user are not allow to read ir.cron and thus an access
error is trigger.

Solution
--------
Read the cron in sudo mode

closes odoo/odoo#68592

X-original-commit: a039bfdf6bc0548d5ed1910f195bf0c62d77d6d0
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Thibault Francois
2021-04-07 07:53:03 +00:00
committed by Thibault Delavallée
parent a9cd07585d
commit 02b0fdded4
+1 -1
View File
@@ -635,7 +635,7 @@ class Meeting(models.Model):
def _setup_alarms(self):
""" Schedule cron triggers for future events """
cron = self.env.ref('calendar.ir_cron_scheduler_alarm')
cron = self.env.ref('calendar.ir_cron_scheduler_alarm').sudo()
alarm_manager = self.env['calendar.alarm_manager']
alarm_types = self._get_trigger_alarm_types()