[FIX] mail: unlink only sent emails, not failed emails.

bzr revid: tde@openerp.com-20140425122726-k5upt8tq5xp4m228
This commit is contained in:
Thibault Delavallée 2014-04-25 14:27:26 +02:00
parent a32d8cb9de
commit 88f7865043
1 changed files with 1 additions and 1 deletions

View File

@ -135,7 +135,7 @@ class mail_mail(osv.Model):
:param browse_record mail: the mail that was just sent
:return: True
"""
if mail.auto_delete:
if mail_sent and mail.auto_delete:
# done with SUPERUSER_ID to avoid giving large unlink access rights
self.unlink(cr, SUPERUSER_ID, [mail.id], context=context)
return True