[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
This commit is contained in:
len-odoo
2018-09-26 08:36:14 +00:00
parent 2bf1af77fb
commit 09340bb7f0
+1
View File
@@ -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.")