diff options
| author | Alexandre Kühn <aku@odoo.com> | 2020-09-10 16:34:50 +0000 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2020-09-24 17:59:12 +0000 |
| commit | b39f39b598d3a930034f9981712cf5ec41ad301c (patch) | |
| tree | 26265a176e9731898ab4b9a13c5fdd048c775fa4 /addons/mail/static/src/models/thread/thread.js | |
| parent | 5fe3ad548e410fbe2eddd7f67aa4b89b81746f1a (diff) | |
[FIX] im_livechat, mail, website_livechat: open chat website visitor
Also fix an issue with livechats not being considered in 'chat'
filter of messaging menu.
Task-Id 2282426
closes odoo/odoo#58466
X-original-commit: 631e52536964763bbfe857305f023e5e67084e95
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models/thread/thread.js')
| -rw-r--r-- | addons/mail/static/src/models/thread/thread.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/addons/mail/static/src/models/thread/thread.js b/addons/mail/static/src/models/thread/thread.js index 09fcd46afed..bd40751ca59 100644 --- a/addons/mail/static/src/models/thread/thread.js +++ b/addons/mail/static/src/models/thread/thread.js @@ -968,6 +968,14 @@ function factory(dependencies) { * @private * @returns {boolean} */ + _computeIsChatChannel() { + return this.channel_type === 'chat'; + } + + /** + * @private + * @returns {boolean} + */ _computeIsCurrentPartnerFollowing() { return this.followers.some(follower => follower.partner && follower.partner === this.env.messaging.currentPartner @@ -1426,6 +1434,19 @@ function factory(dependencies) { ], }), id: attr(), + /** + * States whether this thread is a `mail.channel` qualified as chat. + * + * Useful to list chat channels, like in messaging menu with the filter + * 'chat'. + */ + isChatChannel: attr({ + compute: '_computeIsChatChannel', + dependencies: [ + 'channel_type', + ], + default: false, + }), isCurrentPartnerFollowing: attr({ compute: '_computeIsCurrentPartnerFollowing', default: false, |
