summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models/thread/thread.js
diff options
context:
space:
mode:
authorXavier Dubuc <xdu@odoo.com>2020-06-11 15:19:26 +0000
committerXavier Dubuc <xdu@odoo.com>2020-06-16 15:52:34 +0000
commit4ca549253be2c099294f05d8ba57384e1b7bc0d6 (patch)
treeef439fd6acc1b61c8fa44dc0e3d9b7e8351e8a50 /addons/mail/static/src/models/thread/thread.js
parent57a32316afdd82843d0fe2381a7db5846affdb2d (diff)
[FIX] mail: mark message as seen only when thread composer is focused
task-2272510 closes odoo/odoo#53088 X-original-commit: edf356c2022b3039e53e82a092fc64533f59df27 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models/thread/thread.js')
-rw-r--r--addons/mail/static/src/models/thread/thread.js18
1 files changed, 17 insertions, 1 deletions
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
@@ -11,6 +11,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
*/
init(...args) {
@@ -1140,7 +1157,6 @@ function factory(dependencies) {
dependencies: ['viewersChatWindow'],
}),
composer: one2one('mail.composer', {
- autocreate: true,
inverse: 'thread',
isCausal: true,
}),