From 09340bb7f0da35cc69e24f16e5262ec4825bc0c6 Mon Sep 17 00:00:00 2001 From: len-odoo Date: Wed, 26 Sep 2018 07:43:05 +0000 Subject: [PATCH] [FIX] mail: set the thread_id when creating a new thread After a refactoring for v11, the id of a newly created thread is not returned anymore. Therefore server actions weren't being executed on newly created records. opw 1886383 closes odoo/odoo#27238 --- addons/mail/models/mail_thread.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index 7ffce440383..56214df2fcb 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -1211,6 +1211,7 @@ class MailThread(models.AbstractModel): # if a new thread is created, parent is irrelevant message_dict.pop('parent_id', None) thread = MessageModel.message_new(message_dict, custom_values) + thread_id = thread.id else: if thread_id: raise ValueError("Posting a message without model should be with a null res_id, to create a private message.")