diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index ac7442fa13e..0c53cbad6b1 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -1827,8 +1827,7 @@ class MailThread(models.AbstractModel): raise ValueError('message_post partner_ids and channel_ids must be integer list, not commands') # Find the message's author - author_info = self._message_compute_author(author_id, email_from, raise_exception=True) - author_id, email_from = author_info['author_id'], author_info['email_from'] + author_id, email_from = self._message_compute_author(author_id, email_from, raise_exception=True) if not subtype_id: subtype = subtype or 'mt_note' @@ -1973,8 +1972,7 @@ class MailThread(models.AbstractModel): msg_kwargs = dict((key, val) for key, val in kwargs.items() if key in self.env['mail.message']._fields) notif_kwargs = dict((key, val) for key, val in kwargs.items() if key not in msg_kwargs) - author_info = self._message_compute_author(author_id, email_from, raise_exception=True) - author_id, email_from = author_info['author_id'], author_info['email_from'] + author_id, email_from = self._message_compute_author(author_id, email_from, raise_exception=True) if not partner_ids: _logger.warning('Message notify called without recipient_ids, skipping') @@ -2013,8 +2011,7 @@ class MailThread(models.AbstractModel): the log process. This method should be called within methods where access rights are already granted to avoid privilege escalation. """ self.ensure_one() - author_info = self._message_compute_author(author_id, email_from, raise_exception=False) - author_id, email_from = author_info['author_id'], author_info['email_from'] + author_id, email_from = self._message_compute_author(author_id, email_from, raise_exception=False) message_values = { 'subject': subject, @@ -2038,8 +2035,7 @@ class MailThread(models.AbstractModel): :param bodies: dict {record_id: body} """ - author_info = self._message_compute_author(author_id, email_from, raise_exception=False) - author_id, email_from = author_info['author_id'], author_info['email_from'] + author_id, email_from = self._message_compute_author(author_id, email_from, raise_exception=False) base_message_values = { 'subject': subject, @@ -2079,10 +2075,7 @@ class MailThread(models.AbstractModel): if not email_from and not self.env.su and raise_exception: raise exceptions.UserError(_("Unable to log message, please configure the sender's email address.")) - return { - 'author_id': author_id, - 'email_from': email_from, - } + return author_id, email_from def _message_create(self, values_list): if not isinstance(values_list, (list)):