diff options
| author | Sébastien Theys <seb@odoo.com> | 2021-01-28 10:55:58 +0000 |
|---|---|---|
| committer | Sébastien Theys <seb@odoo.com> | 2021-01-28 10:55:58 +0000 |
| commit | fa398ea291a72fa7752d382f85e6ef2ce7ac4c70 (patch) | |
| tree | 2406dcb022d47409f8843ae03dbb1234398193bc /addons/mail/static/src/components | |
| parent | 45544d024d5e4ad71285d70411b5109f4075b440 (diff) | |
[FIX] mail: make Inbox counters more reliable in mark as read flows
- Send the new Inbox counter when marking as read, to guarantee the JS has the
correct value (instead of having to guess it which was impossible when an
arbitrary domain was given to the method).
NOTE: Manual increment is kept on receiving a new Inbox message because that
one was reliable and it would have been more tricky to compute the new counter
for each target partner (mark as read is one user doing an action for himself,
whereas new message is from another user to potentially many different users).
Generic counter for threads is also not sent on every change for similar
reasons.
- Refresh Inbox automatically when some messages are marked as read and there
are more message on the server than currently loaded.
- Remove confusing (and impossible to maintain) counter on non-origin threads
(in particular channel followers). This behavior in JS was not consistent with
the server which always counted only origin thread (model/res_id).
task-2446302
closes odoo/odoo#65161
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/components')
| -rw-r--r-- | addons/mail/static/src/components/discuss/tests/discuss_tests.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/mail/static/src/components/discuss/tests/discuss_tests.js b/addons/mail/static/src/components/discuss/tests/discuss_tests.js index 59a2b8cc239..dc2005e5ac7 100644 --- a/addons/mail/static/src/components/discuss/tests/discuss_tests.js +++ b/addons/mail/static/src/components/discuss/tests/discuss_tests.js @@ -2574,18 +2574,22 @@ QUnit.test('inbox: mark all messages as read', async function (assert) { body: "not empty", channel_ids: [20], // link message to channel id: 100, // random unique id, useful to link notification + model: 'mail.channel', // needaction needs to be set here for message_fetch domain, because // mocked models don't have computed fields needaction: true, + res_id: 20, }, // second expected message { body: "not empty", channel_ids: [20], // link message to channel id: 101, // random unique id, useful to link notification + model: 'mail.channel', // needaction needs to be set here for message_fetch domain, because // mocked models don't have computed fields needaction: true, + res_id: 20, } ); this.data['mail.notification'].records.push( |
