From ac3f8a7615e5c7664319cd57c4f832f63517a542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 17 May 2013 17:13:09 +0200 Subject: [PATCH] [FIX] mail_thread: fixed bug in contact check, comparing int to list of browse is not a good idea. bzr revid: tde@openerp.com-20130517151309-v0x32829dpwr0dw6 --- addons/mail/mail_thread.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 3151846bc04..b29dd1cbad6 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -616,8 +616,8 @@ class mail_thread(osv.AbstractModel): mail_mail = self.pool.get('mail.mail') mail_id = mail_mail.create(cr, uid, { 'body_html': '

Hello,

' - '

The following email sent to %s cannot be accepted because this address' - 'is private. Only known contacts are allowed to contact this address.

' + '

The following email sent to %s cannot be accepted because this is ' + 'a private email address. Only allowed people can contact us at this address.

' '
%s
' % (message.get('to'), message_dict.get('body')), 'subject': 'Re: %s' % message.get('subject'), 'email_to': message.get('from'), @@ -711,12 +711,11 @@ class mail_thread(osv.AbstractModel): # route contact settings if alias and alias.alias_contact == 'followers' and (thread_id or alias.alias_parent_thread_id): - print alias, alias.alias_contact if thread_id: obj = self.pool[model].browse(cr, uid, thread_id, context=context) else: obj = self.pool[alias.alias_parent_model_id.model].browse(cr, uid, alias.alias_parent_thread_id, context=context) - if not author_id or not author_id in obj.message_follower_ids: + if not author_id or not author_id in [fol.id for fol in obj.message_follower_ids]: _logger.warning('Routing mail with Message-Id %s: route %s: alias %s restricted to internal followers, skipping', message_id, route, alias.alias_name) create_bounce_email()