From c62f105f680ad13a93c73aa168eaff8aac0f6d6a Mon Sep 17 00:00:00 2001
From: Tejas Shahu <tsh@odoo.com>
Date: Tue, 15 May 2018 11:21:09 +0530
Subject: [PATCH] [FIX] mail: fix mismatch between recordset and id

Recently a ref() has been converted into a direct xml id match. As this
does not return a recordset but an ID, the .id that follows is not
necessary anymore.
---
 addons/mail/models/mail_thread.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py
index 5ebfc94cc246..55b3f172af73 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})
-- 
GitLab