diff options
Diffstat (limited to 'addons/mail/models/mail_thread.py')
| -rw-r--r-- | addons/mail/models/mail_thread.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index d41689fdf04..1b52ec94e5d 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -461,7 +461,7 @@ class MailThread(models.AbstractModel): """ self.ensure_one() # get the subtype of the comment Message - subtype_comment = self.env.ref('mail.mt_comment') + subtype_comment = self.env['ir.model.data'].xmlid_to_res_id('mail.mt_comment') # get the ids of the comment and not-comment of the thread # TDE check: sudo on mail.message, to be sure all messages are moved ? @@ -1986,7 +1986,7 @@ class MailThread(models.AbstractModel): 'message_type': 'notification', 'partner_ids': partner_ids, 'model': False, - 'subtype_id': self.env['ir.model.data'].sudo().xmlid_to_res_id('mail.mt_note'), + 'subtype_id': self.env['ir.model.data'].xmlid_to_res_id('mail.mt_note'), 'record_name': False, 'reply_to': self.env['mail.thread'].sudo()._notify_get_reply_to([0])[0], 'message_id': tools.generate_tracking_message_id('message-notify'), @@ -2020,7 +2020,7 @@ class MailThread(models.AbstractModel): 'message_type': message_type, 'model': kwargs.get('model', self._name), 'res_id': self.ids[0] if self.ids else False, - 'subtype_id': self.env.ref('mail.mt_note').id, + 'subtype_id': self.env['ir.model.data'].xmlid_to_res_id('mail.mt_note'), 'record_name': False, 'reply_to': self.env['mail.thread'].sudo()._notify_get_reply_to([0])[0], 'message_id': tools.generate_tracking_message_id('message-notify'), |
