From 4ca549253be2c099294f05d8ba57384e1b7bc0d6 Mon Sep 17 00:00:00 2001 From: Xavier Dubuc Date: Thu, 11 Jun 2020 15:19:26 +0000 Subject: [FIX] mail: mark message as seen only when thread composer is focused MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit task-2272510 closes odoo/odoo#53088 X-original-commit: edf356c2022b3039e53e82a092fc64533f59df27 Signed-off-by: Alexandre Kühn (aku) --- addons/mail/static/src/models/thread/thread.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'addons/mail/static/src/models/thread/thread.js') diff --git a/addons/mail/static/src/models/thread/thread.js b/addons/mail/static/src/models/thread/thread.js index 16f52ab861f..e1fd74a5d77 100644 --- a/addons/mail/static/src/models/thread/thread.js +++ b/addons/mail/static/src/models/thread/thread.js @@ -10,6 +10,23 @@ function factory(dependencies) { class Thread extends dependencies['mail.model'] { + /** + * FIXME With this, whenever client is aware of new thread, this will + * (almost) always focus its composer when displayed. This shouldn't be + * the case, instead auto-focus of composer is flow-specific. + * See task-2277537 + * + * @override + */ + static create(data) { + if (!data.composer) { + data.composer = [['create', { + isDoFocus: true, + }]]; + } + return super.create(data); + } + /** * @override */ @@ -1140,7 +1157,6 @@ function factory(dependencies) { dependencies: ['viewersChatWindow'], }), composer: one2one('mail.composer', { - autocreate: true, inverse: 'thread', isCausal: true, }), -- cgit v1.2.3