diff options
| author | Alexandre Kühn <aku@odoo.com> | 2019-06-13 13:53:01 +0000 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2019-07-16 14:36:44 +0000 |
| commit | bdf45dca506f9938bfcd3a7acc8757a16d701d05 (patch) | |
| tree | dbe074599045aef04eb18935eef2859d555a14c5 /addons/mail/static/src/js/thread_windows/thread_window.js | |
| parent | 4bde721f925bfe3d1e867565490d3830da150dcc (diff) | |
[FIX] mail: auto-update out-of-office info on im_status change
Before this commit, chat window's out-of-office info did not change
when direct partner's `im_status` is/was on 'leave'.
Users had to reload page to see updated out-of-office info.
Task-ID 2007663
Diffstat (limited to 'addons/mail/static/src/js/thread_windows/thread_window.js')
| -rw-r--r-- | addons/mail/static/src/js/thread_windows/thread_window.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/thread_windows/thread_window.js b/addons/mail/static/src/js/thread_windows/thread_window.js index e5496e0bc3c..9f7c1f00bb5 100644 --- a/addons/mail/static/src/js/thread_windows/thread_window.js +++ b/addons/mail/static/src/js/thread_windows/thread_window.js @@ -6,6 +6,7 @@ var BasicComposer = require('mail.composer.Basic'); var core = require('web.core'); +var QWeb = core.qweb; var _t = core._t; /** @@ -153,6 +154,23 @@ var ThreadWindow = AbstractThreadWindow.extend({ removePassive: function () { this._passive = false; }, + renderOutOfOffice: function () { + var $outOfOffice = this.$('.o_out_of_office'); + if (!this.getOutOfOfficeInfo() && !this.getOutOfOfficeMessage()) { + if ($outOfOffice.length) { + $outOfOffice.remove(); + } + return; + } + var $newOutOfOffice = $(QWeb.render('mail.thread_window.OutOfOffice', { + widget: this, + })); + if ($outOfOffice.length) { + $outOfOffice.replaceWith($newOutOfOffice); + } else { + $newOutOfOffice.insertAfter(this.$('.o_thread_window_header')); + } + }, /** * Update this thread window * |
