From ecb56a6893dd7b76402c2262fb93f8dea079fde0 Mon Sep 17 00:00:00 2001 From: Xavier Dubuc Date: Fri, 9 Oct 2020 13:50:45 +0000 Subject: [FIX] mail: fix handling of lastVisibleMessage in channel seen condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit also fix a problem with composer.hasFocus field not always correctly updated (e.g. when switching from a channel to another in discuss) task-2278915 closes odoo/odoo#60079 Signed-off-by: Alexandre Kühn (aku) --- addons/mail/static/src/models/thread_view/thread_view.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'addons/mail/static/src/models/thread_view/thread_view.js') diff --git a/addons/mail/static/src/models/thread_view/thread_view.js b/addons/mail/static/src/models/thread_view/thread_view.js index 6e875133a4b..895732f8872 100644 --- a/addons/mail/static/src/models/thread_view/thread_view.js +++ b/addons/mail/static/src/models/thread_view/thread_view.js @@ -136,6 +136,7 @@ function factory(dependencies) { if (this.threadCache) { this.threadCache.update({ isCacheRefreshRequested: true }); } + this.update({ lastVisibleMessage: [['unlink']] }); } /** @@ -225,12 +226,15 @@ function factory(dependencies) { * hint `message-received`. */ hasAutoScrollOnMessageReceived: attr(), + /** + * Last message in the context of the currently displayed thread cache. + */ lastMessage: many2one('mail.message', { related: 'thread.lastMessage', }), /** * Most recent message in this ThreadView that has been shown to the - * current partner. + * current partner in the currently displayed thread cache. */ lastVisibleMessage: many2one('mail.message'), messages: many2many('mail.message', { -- cgit v1.2.3