summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/thread_widget.js
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2019-09-27 14:35:30 +0000
committerfw-bot <otis@odoo.com>2019-10-14 19:35:20 +0000
commit1049fabfa6fb00ab71d8dddc5b6df261b48ddcad (patch)
tree953809f326ef0969259d206c4ceca0c4789624f5 /addons/mail/static/src/js/thread_widget.js
parentec48a8341d0546de343ad3a6079237dbf4d39d69 (diff)
[FIX] mail: messaging ready after 1st chatter rendering
Revision on https://github.com/odoo/odoo/commit/9a66619db33fca5f0cb81d9f6bfeb0fb0290cf68 Commit above improves the web client startup by not having to wait for discuss widgets to fully load beforehand. However, it introduced an issue with chatter when the 1st rendering happens before messaging becomes ready: it displays "Creating a record..." instead of the whole history of messages. This happens because when messaging is ready, it updates data from the chatter but it does not trigger a re-render. This commit fixes the issue by triggering a re-render on messaging ready. When messaging is not ready, thread field now displays "Loading..." instead of the message "Creating a record...". Task-Id 2078193 closes odoo/odoo#38751 X-original-commit: 93bdd7c91095025f4d6e7a058e0ab1c4e1a0ad60 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/js/thread_widget.js')
-rw-r--r--addons/mail/static/src/js/thread_widget.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/thread_widget.js b/addons/mail/static/src/js/thread_widget.js
index 9550931ad95..3ec66d02520 100644
--- a/addons/mail/static/src/js/thread_widget.js
+++ b/addons/mail/static/src/js/thread_widget.js
@@ -55,6 +55,7 @@ var ThreadWidget = Widget.extend({
*/
init: function (parent, options) {
this._super.apply(this, arguments);
+ this.attachments = [];
// options when the thread is enabled (e.g. can send message,
// interact on messages, etc.)
this._enabledOptions = _.defaults(options || {}, {
@@ -220,6 +221,14 @@ var ThreadWidget = Widget.extend({
}
},
+ /**
+ * Render thread widget when loading, i.e. when messaging is not yet ready.
+ * @see /mail/init_messaging
+ */
+ renderLoading: function () {
+ this.$el.html(QWeb.render('mail.widget.ThreadLoading'));
+ },
+
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------