diff options
| author | Thibault Delavallée <tde@openerp.com> | 2014-02-04 17:59:49 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2014-02-04 17:59:49 +0100 |
| commit | a7c7e331315b849e7c024e255977ff5a9fdca2ac (patch) | |
| tree | 800e54cc058ee281448114580b9c0bbe9ef5bf6d | |
| parent | 612fcf8540356cd781275c0abedc76d563e97590 (diff) | |
[FIX] mass_mailing: fixed variables used outside of their scope
bzr revid: tde@openerp.com-20140204165949-9xax1pul22ktsf41
| -rw-r--r-- | addons/mass_mailing/mail_thread.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/mass_mailing/mail_thread.py b/addons/mass_mailing/mail_thread.py index 0570596ba12..a4ff15a1a3f 100644 --- a/addons/mass_mailing/mail_thread.py +++ b/addons/mass_mailing/mail_thread.py @@ -48,6 +48,7 @@ class MailThread(osv.Model): if bounce_alias in email_to: bounce_match = tools.bounce_re.search(email_to) if bounce_match: + bounced_model, bounced_thread_id = None, False bounced_mail_id = bounce_match.group(1) stat_ids = self.pool['mail.mail.statistics'].set_bounced(cr, uid, mail_mail_ids=[bounced_mail_id], context=context) for stat in self.pool['mail.mail.statistics'].browse(cr, uid, stat_ids, context=context): @@ -55,7 +56,7 @@ class MailThread(osv.Model): bounced_thread_id = stat.res_id _logger.info('Routing mail from %s to %s with Message-Id %s: bounced mail from mail %s, model: %s, thread_id: %s', email_from, email_to, message_id, bounced_mail_id, bounced_model, bounced_thread_id) - if bounced_model and bounced_model in self.pool and hasattr(self.pool[bounced_model], 'message_receive_bounce'): + if bounced_model and bounced_model in self.pool and hasattr(self.pool[bounced_model], 'message_receive_bounce') and bounced_thread_id: self.pool[bounced_model].message_receive_bounce(cr, uid, [bounced_thread_id], mail_id=bounced_mail_id, context=context) return False |
