From a2d3d1df80c044ed62a02e47d7dca242b385992d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 29 Oct 2012 11:12:30 +0100 Subject: [PATCH] [CLEAN] message_post_api: removed unnecessary type arg (posting is a comment). bzr revid: tde@openerp.com-20121029101230-x39pep9p5edd54ml --- addons/mail/mail_thread.py | 5 ++--- addons/mail/res_users.py | 5 ++--- addons/mail/static/src/js/mail.js | 1 - 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index c5ec4c2b17a..e986f12b822 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -707,13 +707,12 @@ class mail_thread(osv.AbstractModel): return mail_message.create(cr, uid, values, context=context) - def message_post_api(self, cr, uid, thread_id, body='', subject=False, type='notification', - parent_id=False, attachment_ids=None, context=None): + def message_post_api(self, cr, uid, thread_id, body='', subject=False, parent_id=False, attachment_ids=None, context=None): """ Wrapper on message_post, used only in Chatter (JS). The purpose is to handle attachments. # TDE FIXME: body is plaintext: convert it into html """ - new_message_id = self.message_post(cr, uid, thread_id=thread_id, body=body, subject=subject, type=type, + new_message_id = self.message_post(cr, uid, thread_id=thread_id, body=body, subject=subject, type='comment', subtype='mail.mt_comment', parent_id=parent_id, context=context) # HACK FIXME: Chatter: attachments linked to the document (not done JS-side), load the message diff --git a/addons/mail/res_users.py b/addons/mail/res_users.py index 4ef2dda6d9c..1b6388111ba 100644 --- a/addons/mail/res_users.py +++ b/addons/mail/res_users.py @@ -111,8 +111,7 @@ class res_users(osv.Model): alias_pool.unlink(cr, uid, alias_ids, context=context) return res - def message_post_api(self, cr, uid, thread_id, body='', subject=False, type='notification', - parent_id=False, attachment_ids=None, context=None, **kwargs): + def message_post_api(self, cr, uid, thread_id, body='', subject=False, parent_id=False, attachment_ids=None, context=None): """ Redirect the posting of message on res.users to the related partner. This is done because when giving the context of Chatter on the various mailboxes, we do not have access to the current partner_id. @@ -124,7 +123,7 @@ class res_users(osv.Model): thread_id = thread_id[0] partner_id = self.pool.get('res.users').read(cr, uid, thread_id, ['partner_id'], context=context)['partner_id'][0] return self.pool.get('res.partner').message_post_api(cr, uid, partner_id, body=body, subject=subject, - type=type, parent_id=parent_id, attachment_ids=attachment_ids, context=context, **kwargs) + parent_id=parent_id, attachment_ids=attachment_ids, context=context) def message_post(self, cr, uid, thread_id, context=None, **kwargs): """ Redirect the posting of message on res.users to the related partner. diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 6a409782117..0b6a8ec86d2 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -358,7 +358,6 @@ openerp.mail = function (session) { this.context.default_res_id, mail.ChatterUtils.get_text2html(body), false, - 'comment', this.context.default_parent_id, attachments, this.parent_thread.context