From d0d14766fc5bda5eede3a3402f52b4e6ae11e01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 23 Aug 2012 17:02:29 +0200 Subject: [PATCH] [FIX] mail.js: fixed do_action of Wall. bzr revid: tde@openerp.com-20120823150229-7vp9hbfb80bo29xf --- addons/mail/static/src/js/mail.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 14183f13b1c..a3e53a9d948 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -251,6 +251,7 @@ openerp.mail = function(session) { * @param {Number} [options.records=null] records to show instead of fetching messages */ init: function(parent, options) { + console.log(parent); this._super(parent); // options this.options = options || {}; @@ -374,7 +375,7 @@ openerp.mail = function(session) { * Normally it should be called only when clicking on 'Post/Send' * in the composition form. */ do_action: function(action, on_close) { - console.log('thread do_action'); + console.log('thread do_action', action, on_close, this); this.message_clean(); this.message_fetch(); if (this.compose_message_widget) { @@ -600,6 +601,7 @@ openerp.mail = function(session) { }, set_value: function() { + var self = this; this._super.apply(this, arguments); if (! this.view.datarecord.id || session.web.BufferedDataSet.virtual_id_regex.test(this.view.datarecord.id)) { this.$element.find('oe_mail_thread').hide(); @@ -611,7 +613,8 @@ openerp.mail = function(session) { // create and render Thread widget this.$element.find('div.oe_mail_recthread_main').empty(); for (var i in this.thread_list) { this.thread_list[i].destroy(); } - var thread = new mail.Thread(this, { + console.log(this); + var thread = new mail.Thread(self, { 'context': this.options.context, 'uid': this.session.uid, 'thread_level': this.options.thread_level, 'show_header_compose': true, 'show_delete': true, 'composer': true }); @@ -678,7 +681,7 @@ openerp.mail = function(session) { if (this.compose_message_widget) { this.compose_message_widget.refresh(); } this.message_clean(); - this.message_fetch(); + this.display_thread(); return this._super(action, on_close); }, @@ -729,7 +732,7 @@ openerp.mail = function(session) { display_thread: function () { var render_res = session.web.qweb.render('mail.wall_thread_container', {}); $('
  • ').html(render_res).appendTo(this.$element.find('ul.oe_mail_wall_threads')); - var thread = new mail.Thread(self, { + var thread = new mail.Thread(this, { 'domain': this.options.domain, 'context': this.options.context, 'uid': this.session.uid, 'thread_level': this.options.thread_level, 'composer': true, // display options