From e34fcc076cdcda1ed6da1cd6ba6aa567eeb0d0c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 6 Sep 2012 14:20:46 +0200 Subject: [PATCH] [FIX] mail.js: fixed wrong res_id passed into subthreads; fixed message_post using a wrong dataset; fixed message_post calling message_fetch after posting with a proxy that gave default values, use a then without args instead. bzr revid: tde@openerp.com-20120906122046-g8vqkqlbb2ymb6ad --- addons/mail/static/src/js/mail.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 1f2d9fda6a6..94ce41802cc 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -478,7 +478,7 @@ openerp.mail = function(session) { self.thread = new mail.Thread(self, { 'context': { 'default_model': record.model, - 'default_id': record.res_id, + 'default_res_id': record.res_id, 'default_parent_id': record.id }, 'message_data': record.child_ids, 'thread_level': self.options.thread_level-1, 'show_header_compose': false, 'show_reply': self.options.thread_level > 1, @@ -547,9 +547,9 @@ openerp.mail = function(session) { var body = comment_node.val(); comment_node.val(''); } - return this.ds_post.call('message_post', [ - [this.options.context.res_id], body, false, 'comment', this.options.context.parent_id] - ).then(this.proxy('message_fetch')); + return this.ds_thread.call('message_post', [ + [this.options.context.default_res_id], body, false, 'comment', this.options.context.default_parent_id, undefined] + ).then(self.message_fetch()); }, /** Action: 'shows more' to fetch new messages */