Fix allow_mail_archived_partner causing system notifications to send emails

This commit is contained in:
Kristof Bernaert
2026-01-26 03:49:31 +01:00
parent 4d6e55af0f
commit 17c453a322
2 changed files with 52 additions and 34 deletions
@@ -88,10 +88,16 @@ class MailComposeMessage(models.TransientModel):
def action_send_mail(self):
"""
Override send action to log and ensure context.
Log when email is actually sent.
"""
_logger.debug("=== MAIL.COMPOSE.MESSAGE action_send_mail ===")
_logger.debug(f"Context: {dict(self.env.context)}")
_logger.debug(f"Partner IDs: {self.partner_ids.ids}")
return super().action_send_mail()
_logger.info("🔥 MAIL.COMPOSE.MESSAGE action_send_mail")
_logger.info(f"Partner IDs: {self.partner_ids.ids}")
_logger.info(f"Context: {dict(self.env.context)}")
return super().action_send_mail()
def _action_send_mail(self, auto_commit=False):
"""
Another possible send method.
"""
_logger.info("🔥 MAIL.COMPOSE.MESSAGE _action_send_mail")
return super()._action_send_mail(auto_commit=auto_commit)