Skip to content
Snippets Groups Projects
Commit ca6cc05c authored by Didier (did)'s avatar Didier (did)
Browse files

[FIX] mail: force the model when creating basic thread


closes odoo/odoo#60285

Signed-off-by: default avatarSébastien Theys (seb) <seb@odoo.com>
parent b70e3456
Branches
Tags
No related merge requests found
......@@ -673,9 +673,11 @@ function factory(dependencies) {
this.update({
suggestedChannels: [[
'insert-and-replace',
mentions.map(data =>
this.env.models['mail.thread'].convertData(data))
]],
mentions.map(data => {
const threadData = this.env.models['mail.thread'].convertData(data);
return Object.assign({ model: 'mail.channel' }, threadData);
})
]],
});
if (this.suggestedChannels[0]) {
......
......@@ -163,7 +163,9 @@ function factory(dependencies) {
// channels received at init.
convertedData.members = [['link', this.env.messaging.currentPartner]];
}
const channel = this.env.models['mail.thread'].insert(convertedData);
const channel = this.env.models['mail.thread'].insert(
Object.assign({ model: 'mail.channel' }, convertedData)
);
// flux specific: channels received at init have to be
// considered pinned. task-2284357
if (!channel.isPinned) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment