diff options
Diffstat (limited to 'addons/microsoft_calendar/models/calendar_attendee.py')
| -rw-r--r-- | addons/microsoft_calendar/models/calendar_attendee.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/addons/microsoft_calendar/models/calendar_attendee.py b/addons/microsoft_calendar/models/calendar_attendee.py new file mode 100644 index 00000000..9a462c38 --- /dev/null +++ b/addons/microsoft_calendar/models/calendar_attendee.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models + +from odoo.addons.microsoft_calendar.models.microsoft_sync import microsoft_calendar_token + + +class Attendee(models.Model): + _name = 'calendar.attendee' + _inherit = 'calendar.attendee' + + def _send_mail_to_attendees(self, template_xmlid, force_send=False, ignore_recurrence=False): + """ Override the super method + If not synced with Microsoft Outlook, let Odoo in charge of sending emails + Otherwise, Microsoft Outlook will send them + """ + with microsoft_calendar_token(self.env.user.sudo()) as token: + if not token: + super()._send_mail_to_attendees(template_xmlid, force_send, ignore_recurrence) |
