[FIX] mail: allow sending notification emails
Add back the 'sudo()' on batch mail unlinking. Sudo is necessary to delete user notifications on auto-delete. Which makes sense as the recipient would have an email for it anyway. The sudo was there as far back as:c5c369355dThen transfered in this change:036a739b62And removed in the recent optimization here: e38bfd25df1bb25e7e5695b536052d5a0c85c5c4 task-3225207 closes odoo/odoo#115956 X-original-commit: 93a28f17024511e30d3c70eb847c361ca87e0ffe Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com> Signed-off-by: Thiry Renaud (reth) <reth@odoo.com>
This commit is contained in:
@@ -262,7 +262,7 @@ class MailMail(models.Model):
|
||||
# TDE TODO: could be great to notify message-based, not notifications-based, to lessen number of notifs
|
||||
messages._notify_message_notification_update() # notify user that we have a failure
|
||||
if not failure_type or failure_type in ['mail_email_invalid', 'mail_email_missing']: # if we have another error, we want to keep the mail.
|
||||
self.filtered(lambda mail: mail.auto_delete).unlink()
|
||||
self.sudo().filtered(lambda mail: mail.auto_delete).unlink()
|
||||
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user