[MIG] mass_mailing: Remaining self.pool in 'message_route_check_bounce'

This commit is contained in:
Yannick Tivisse
2016-08-09 10:29:06 +02:00
parent 897627498b
commit 84dd711ce3
+1 -1
View File
@@ -43,7 +43,7 @@ class MailThread(models.AbstractModel):
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.env[bounced_model], 'message_receive_bounce') and bounced_thread_id:
if bounced_model and bounced_model in self.env and hasattr(self.env[bounced_model], 'message_receive_bounce') and bounced_thread_id:
self.env[bounced_model].browse(bounced_thread_id).message_receive_bounce(mail_id=bounced_mail_id)
return False