diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index 5ebfc94cc24..55b3f172af7 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -474,11 +474,11 @@ class MailThread(models.AbstractModel): msg_comment = MailMessage.search([ ('model', '=', self._name), ('res_id', '=', self.id), - ('subtype_id', '=', subtype_comment.id)]) + ('subtype_id', '=', subtype_comment)]) msg_not_comment = MailMessage.search([ ('model', '=', self._name), ('res_id', '=', self.id), - ('subtype_id', '!=', subtype_comment.id)]) + ('subtype_id', '!=', subtype_comment)]) # update the messages msg_comment.write({"res_id": new_thread.id, "model": new_thread._name})