diff options
| author | mgh-odoo <mgh@odoo.com> | 2019-10-23 11:43:29 +0000 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2019-11-29 08:56:15 +0000 |
| commit | 5c004c2e832a9ca6efbe1df1160051ed2cd44c5d (patch) | |
| tree | b8ed62b2f83a7cf6a1922f2a141634b6230fea22 /addons/mail/static/src/js/thread_windows | |
| parent | bf18802c1dd00fb9b8b82cd6a884ce6b96eb1f09 (diff) | |
[IMP] mail: show out of office ribbon on discuss
This commit adds the out-of-office ribbon at the top of the
conversation in the discuss app.
Task-2066672
closes odoo/odoo#39362
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Diffstat (limited to 'addons/mail/static/src/js/thread_windows')
| -rw-r--r-- | addons/mail/static/src/js/thread_windows/abstract_thread_window.js | 24 | ||||
| -rw-r--r-- | addons/mail/static/src/js/thread_windows/thread_window.js | 7 |
2 files changed, 4 insertions, 27 deletions
diff --git a/addons/mail/static/src/js/thread_windows/abstract_thread_window.js b/addons/mail/static/src/js/thread_windows/abstract_thread_window.js index d6a637a0552..27cb97e1f65 100644 --- a/addons/mail/static/src/js/thread_windows/abstract_thread_window.js +++ b/addons/mail/static/src/js/thread_windows/abstract_thread_window.js @@ -147,32 +147,10 @@ var AbstractThreadWindow = Widget.extend({ * @returns {mail.model.Thread|undefined} */ getThread: function () { - if (!this.hasThread) { - return undefined; - } - return this._thread; - }, - /** - *Get out of office info - * - * @returns {string|undefined} - */ - getOutOfOfficeInfo: function () { - if (!this.hasThread()) { - return undefined; - } - return this._thread.getOutOfOfficeInfo(); - }, - /** - * Get out of office user text - * - * @returns {string|undefined} - */ - getOutOfOfficeMessage: function () { if (!this.hasThread()) { return undefined; } - return this._thread.getOutOfOfficeMessage(); + return this._thread; }, /** * Get the status of the thread, such as the im status of a DM chat 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 08671354a3e..8b4eb03d9db 100644 --- a/addons/mail/static/src/js/thread_windows/thread_window.js +++ b/addons/mail/static/src/js/thread_windows/thread_window.js @@ -148,15 +148,14 @@ var ThreadWindow = AbstractThreadWindow.extend({ }, renderOutOfOffice: function () { var $outOfOffice = this.$('.o_out_of_office'); - if (!this.getOutOfOfficeInfo() && !this.getOutOfOfficeMessage()) { + const thread = this.getThread(); + if (!thread.hasOutOfOffice()) { if ($outOfOffice.length) { $outOfOffice.remove(); } return; } - var $newOutOfOffice = $(QWeb.render('mail.thread_window.OutOfOffice', { - widget: this, - })); + const $newOutOfOffice = $(QWeb.render('mail.thread.OutOfOffice', { thread })); if ($outOfOffice.length) { $outOfOffice.replaceWith($newOutOfOffice); } else { |
