diff options
| author | Alexandre Kühn <aku@odoo.com> | 2020-09-07 09:26:38 +0000 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2020-09-11 10:40:22 +0000 |
| commit | 4a693c0233d3fbfdc991e2ccbfcbcd2d360ce788 (patch) | |
| tree | 79d4b3124355f7fdf4cb0cf18578bba24b2aa344 /addons/mail | |
| parent | 170cd2a0217c8d172115dee32e1e0e5e0451fc7a (diff) | |
[FIX] im_livechat, mail, website_livechat: invite button in livechats
Task-2334724
closes odoo/odoo#57505
X-original-commit: 5316c91c27e48bfaa3ebf3fb97e35220fabc986e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail')
| -rw-r--r-- | addons/mail/static/src/models/partner/partner.js | 8 | ||||
| -rw-r--r-- | addons/mail/static/src/widgets/discuss/discuss.js | 15 |
2 files changed, 11 insertions, 12 deletions
diff --git a/addons/mail/static/src/models/partner/partner.js b/addons/mail/static/src/models/partner/partner.js index 0b08451efcd..eb56720b862 100644 --- a/addons/mail/static/src/models/partner/partner.js +++ b/addons/mail/static/src/models/partner/partner.js @@ -8,8 +8,6 @@ const utils = require('web.utils'); function factory(dependencies) { - let nextPublicId = -1; - class Partner extends dependencies['mail.model'] { //---------------------------------------------------------------------- @@ -67,12 +65,6 @@ function factory(dependencies) { return data2; } - static getNextPublicId() { - const id = nextPublicId; - nextPublicId -= 1; - return id; - } - /** * Search for partners matching `keyword`. * diff --git a/addons/mail/static/src/widgets/discuss/discuss.js b/addons/mail/static/src/widgets/discuss/discuss.js index 53ed2f73b00..ac1eea69bf0 100644 --- a/addons/mail/static/src/widgets/discuss/discuss.js +++ b/addons/mail/static/src/widgets/discuss/discuss.js @@ -164,6 +164,16 @@ const DiscussWidget = AbstractAction.extend({ }, /** * @private + * @returns {boolean} + */ + _shouldHaveInviteButton() { + return ( + this.discuss.thread && + this.discuss.thread.channel_type === 'channel' + ); + }, + /** + * @private */ _showRainbowMan() { this.trigger_up('show_effect', { @@ -176,10 +186,7 @@ const DiscussWidget = AbstractAction.extend({ */ _updateControlPanel() { // Invite - if ( - this.discuss.thread && - this.discuss.thread.channel_type === 'channel' - ) { + if (this._shouldHaveInviteButton()) { this.$buttons.find('.o_invite').removeClass('o_hidden'); } else { this.$buttons.find('.o_invite').addClass('o_hidden'); |
