From e81609ff10cf2ab5a8d6a85aaccaccd42c9ff628 Mon Sep 17 00:00:00 2001 From: Adam Heinz Date: Mon, 16 Mar 2026 12:29:15 -0400 Subject: [PATCH] [FIX] OO-1431 Inactive mail templates should not send mail. --- addons/calendar/models/calendar_attendee.py | 2 ++ addons/calendar/tests/test_event_notifications.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/addons/calendar/models/calendar_attendee.py b/addons/calendar/models/calendar_attendee.py index eaddc86ea82504..62d8eb0ccf74c6 100644 --- a/addons/calendar/models/calendar_attendee.py +++ b/addons/calendar/models/calendar_attendee.py @@ -128,6 +128,8 @@ def _send_mail_to_attendees(self, mail_template, force_send=False): if not mail_template: _logger.warning("No template passed to %s notification process. Skipped.", self) return False + if not mail_template.active: + return False # get ics file for all meetings ics_files = notified_attendees.event_id._get_ics_file() diff --git a/addons/calendar/tests/test_event_notifications.py b/addons/calendar/tests/test_event_notifications.py index 6d0de1881ca777..263adc2fdcfc18 100644 --- a/addons/calendar/tests/test_event_notifications.py +++ b/addons/calendar/tests/test_event_notifications.py @@ -78,6 +78,11 @@ def test_message_inactive_invite(self): with self.assertNoNotifications(): self.event.partner_ids = self.partner + def test_message_inactive_template(self): + self.env['mail.template'].search([]).active = False + with self.assertNoNotifications(): + self.event.partner_ids = self.partner + def test_message_set_inactive_invite(self): self.event.active = False with self.assertNoNotifications():