From 540248ed9ea38846a417bee3c7d08966e1ae6e6a Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 11 Oct 2012 12:40:48 +0200 Subject: [PATCH] [IMP] mail: cleaner code bzr revid: chm@openerp.com-20121011104048-4vy0k8pp1rrjug1k --- addons/mail/mail_message.py | 2 +- addons/mail/mail_thread.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 9631918050a..975e7fc1aaf 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -509,7 +509,7 @@ class mail_message(osv.Model): Call mail_notification.notify to manage the email sending """ message = self.browse(cr, uid, newid, context=context) - if message and (message.is_private!=False and message.is_private!=None): + if not message: self._notify_followers(cr, uid, newid, message, context=context) # add myself if I wrote on my wall, diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index e5b93ac4000..cb69b08a86d 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -708,7 +708,7 @@ class mail_thread(osv.AbstractModel): attachment_ids=[] if attachments: ir_attachment = self.pool.get('ir.attachment') - attachment_ids = ir_attachment.search(cr, 1, [('res_model', '=', ""), ('res_id', '=', ""), ('user_id', '=', uid), ('id', 'in', attachments)], context=context) + attachment_ids = ir_attachment.search(cr, 1, [('res_model', '=', False), ('res_id', '=', False), ('user_id', '=', uid), ('id', 'in', attachments)], context=context) if attachment_ids: self.pool.get('ir.attachment').write(cr, 1, attachment_ids, { 'res_model': self._name, 'res_id': thread_id }, context=context) self.pool.get('mail.message').write(cr, 1, [added_message_id], {'attachment_ids': [(6, 0, [pid for pid in attachment_ids])]} )