From 915c5d2053e98acc8dd86d87fe032a11dddac2d9 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Tue, 1 Sep 2015 13:10:53 +0200 Subject: [PATCH] [FIX] mail,mail_tip: trigger event when chatter is ready The code in mail_tip included former implementation of the timeline view, which is now replaced by slack. --- addons/mail/static/src/js/mail_chatter.js | 2 +- addons/mail_tip/static/src/js/mail_tip.js | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/addons/mail/static/src/js/mail_chatter.js b/addons/mail/static/src/js/mail_chatter.js index 2a4ace5b0da..760f3d1f05a 100644 --- a/addons/mail/static/src/js/mail_chatter.js +++ b/addons/mail/static/src/js/mail_chatter.js @@ -349,7 +349,7 @@ var ChatterMailThread = form_common.AbstractField.extend(mail_thread.MailThreadM 'default_model': this.view.model || false, }, this.options.context || {}); // fetch messages of current document - this.message_format(this.get_value().slice(0, mail_thread.LIMIT_MESSAGE)).then(function(raw_messages){ + return this.message_format(this.get_value().slice(0, mail_thread.LIMIT_MESSAGE)).then(function(raw_messages){ self._message_replace(self._message_preprocess(raw_messages)); self.record_name = _.last(raw_messages) ? _.last(raw_messages).record_name : ''; // set the thread as read diff --git a/addons/mail_tip/static/src/js/mail_tip.js b/addons/mail_tip/static/src/js/mail_tip.js index 423408a0551..fa9151b79d4 100644 --- a/addons/mail_tip/static/src/js/mail_tip.js +++ b/addons/mail_tip/static/src/js/mail_tip.js @@ -1,15 +1,14 @@ odoo.define('mail_tip.mail_tip', function (require) { "use strict"; -var mail = require('mail.mail'); -var core = require('web.core'); +var mail = require('mail.chatter'); -mail.MailThread.include({ - message_fetch: function() { +mail.ChatterMailThread.include({ + render_value: function() { var self = this; - return this._super.apply(this, arguments).done(function() { + this._super.apply(this, arguments).done(function() { // event has to be triggered on form view - self.parent_view.trigger('chatter_messages_displayed'); + self.view.trigger('chatter_messages_displayed'); }); } });