Fix allow_mail_archived_partner causing system notifications to send emails

This commit is contained in:
Kristof Bernaert
2026-01-26 02:37:29 +01:00
parent bc4557b473
commit 02a172f582
3 changed files with 84 additions and 16 deletions
@@ -83,4 +83,15 @@ class MailComposeMessage(models.TransientModel):
}
# Default behavior for active partners or non-manual sends
return super()._prepare_recipient_values(partner)
return super()._prepare_recipient_values(partner)
def action_send_mail(self):
"""
Override send action to log and ensure context.
"""
_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()