diff --git a/addons/bus/static/tests/helpers/mock_server.js b/addons/bus/static/tests/helpers/mock_server.js index 7302d55a25e..7667fe4b11f 100644 --- a/addons/bus/static/tests/helpers/mock_server.js +++ b/addons/bus/static/tests/helpers/mock_server.js @@ -118,15 +118,13 @@ patch(MockServer.prototype, { if (typeof target === "string") { return channel === target; } + if (Array.isArray(channel) !== Array.isArray(target)) { + return false; + } if (Array.isArray(channel)) { - const { __model: cModel, id: cId } = channel; - const { __model: tModel, id: tId } = target; - return ( - Array.isArray(target) && - cModel === tModel && - cId === tId && - channel[1] === target[1] - ); + const { __model: cModel, id: cId } = channel[0]; + const { __model: tModel, id: tId } = target[0]; + return cModel === tModel && cId === tId && channel[1] === target[1]; } return channel?.__model === target.__model && channel?.id === target?.id; }) diff --git a/addons/mail/models/discuss/discuss_channel.py b/addons/mail/models/discuss/discuss_channel.py index 42503e08a34..9f0ebaa956d 100644 --- a/addons/mail/models/discuss/discuss_channel.py +++ b/addons/mail/models/discuss/discuss_channel.py @@ -583,7 +583,9 @@ class Channel(models.Model): # notification of the message itself to ensure the channel automatically opens. payload = {"id": self.id, "last_interest_dt": fields.Datetime.now()} bus_notifications = [ - ((self, "members"), "mail.record/insert", {"Thread": {"id": self.id, "is_pinned": True}}), + ((self, "members"), "mail.record/insert", { + "Thread": {"id": self.id, "is_pinned": True, "model": "discuss.channel"} + }), (self, "discuss.channel/last_interest_dt_changed", payload), (self, "discuss.channel/new_message", {"id": self.id, "message": message_format}), ] diff --git a/addons/mail/static/tests/helpers/mock_server/models/mail_thread.js b/addons/mail/static/tests/helpers/mock_server/models/mail_thread.js index 8fea8010a77..ee459770fb8 100644 --- a/addons/mail/static/tests/helpers/mock_server/models/mail_thread.js +++ b/addons/mail/static/tests/helpers/mock_server/models/mail_thread.js @@ -341,6 +341,7 @@ patch(MockServer.prototype, { Thread: { id: channel.id, is_pinned: true, + model: "discuss.channel", }, }, ]);