[FIX] mail: message sent twice because of the wrong tempId

task #3356870
Before this fix, at the first time of sending message in a chat, the tempId of the message in the chatter, crashes the getting lastMessageId and the first tempId in the chat becomes NaN.

closes odoo/odoo#125424

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Maryam Kia
2023-06-19 13:35:34 +02:00
parent 81be42d8f9
commit f5dd14e8ce
@@ -106,7 +106,7 @@ patch(ThreadService.prototype, "mail/core/web", {
type: "chatter",
});
if (resId === false) {
const tmpId = `virtual${this.nextId++}`;
const tmpId = this.messageService.getNextTemporaryId();
const tmpData = {
id: tmpId,
author: { id: this.store.self.id },