diff --git a/addons/mail/static/src/core/common/message.xml b/addons/mail/static/src/core/common/message.xml
index ade64face50..86fa237e177 100644
--- a/addons/mail/static/src/core/common/message.xml
+++ b/addons/mail/static/src/core/common/message.xml
@@ -18,7 +18,7 @@
-
+
diff --git a/addons/mail/static/src/core/common/thread_model.js b/addons/mail/static/src/core/common/thread_model.js
index ef368c0a41f..0a2f65ee90e 100644
--- a/addons/mail/static/src/core/common/thread_model.js
+++ b/addons/mail/static/src/core/common/thread_model.js
@@ -492,7 +492,7 @@ export class Thread extends Record {
}
get persistentMessages() {
- return this.messages.filter((message) => !message.isTransient);
+ return this.messages.filter((message) => !message.is_transient);
}
get prefix() {
diff --git a/addons/mail/static/tests/message/message_tests.js b/addons/mail/static/tests/message/message_tests.js
index 4ec78263108..4555b9429e8 100644
--- a/addons/mail/static/tests/message/message_tests.js
+++ b/addons/mail/static/tests/message/message_tests.js
@@ -9,6 +9,8 @@ import { deserializeDateTime } from "@web/core/l10n/dates";
import { getOrigin } from "@web/core/utils/urls";
import {
makeDeferred,
+ nextTick,
+ patchDate,
patchTimeZone,
patchWithCleanup,
triggerHotkey,
@@ -672,6 +674,41 @@ QUnit.test("should not be able to reply to temporary/transient messages", async
await contains(".o-mail-Message [title='Reply']", { count: 0 });
});
+QUnit.test("squashed transient message should not have date in the sidebar", async () => {
+ patchDate(2024, 2, 26, 10, 0, 0);
+ const pyEnv = await startServer();
+ const channelId = pyEnv["discuss.channel"].create({ name: "Channel 1" });
+ pyEnv["mail.message"].create([
+ {
+ body: "Hello world 1",
+ model: "discuss.channel",
+ res_id: channelId,
+ },
+ {
+ body: "Hello world 2",
+ model: "discuss.channel",
+ res_id: channelId,
+ },
+ ]);
+ const { openDiscuss } = await start();
+ await openDiscuss(channelId);
+ await click(".o-mail-Message.o-squashed");
+ await contains(".o-mail-Message.o-squashed .o-mail-Message-sidebar", {
+ text: "10:00",
+ });
+ await insertText(".o-mail-Composer-input", "/who");
+ await click(".o-mail-Composer-send:enabled");
+ await contains(".o-mail-Message", { text: "You are alone in this channel." });
+ await insertText(".o-mail-Composer-input", "/who");
+ await click(".o-mail-Composer-send:enabled");
+ await click(":nth-child(2 of .o-mail-Message.o-squashed");
+ await nextTick();
+ await contains(":nth-child(2 of .o-mail-Message.o-squashed) .o-mail-Message-sidebar", {
+ text: "10:00",
+ count: 0,
+ });
+});
+
QUnit.test("message comment of same author within 1min. should be squashed", async () => {
// messages are squashed when "close", e.g. less than 1 minute has elapsed
// from messages of same author and same thread. Note that this should