diff --git a/mail_optional_follower_notification/wizard/mail_compose_message.py b/mail_optional_follower_notification/wizard/mail_compose_message.py index 151e19e1a..0cd83ec37 100644 --- a/mail_optional_follower_notification/wizard/mail_compose_message.py +++ b/mail_optional_follower_notification/wizard/mail_compose_message.py @@ -10,7 +10,15 @@ class MailComposeMessage(models.TransientModel): notify_followers = fields.Boolean(default=True) def _action_send_mail(self, auto_commit=False): + result_mails_su, result_messages = ( + self.env["mail.mail"].sudo(), + self.env["mail.message"], + ) for wizard in self: wizard = wizard.with_context(notify_followers=wizard.notify_followers) - super(MailComposeMessage, wizard)._action_send_mail(auto_commit=auto_commit) - return True + res_mail, res_message = super(MailComposeMessage, wizard)._action_send_mail( + auto_commit=auto_commit + ) + result_mails_su += res_mail + result_messages += res_message + return result_mails_su, result_messages