From 910bc5f00a5ad4838cc3c2693dfd097134921a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 7 Sep 2012 13:54:22 +0200 Subject: [PATCH] [REV] Reverted hack about attachments, that was not good. bzr revid: tde@openerp.com-20120907115422-zfynv8pdsxk5p3vg --- addons/mail/mail_message.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 5fa9b8c45d7..18a88bb0b61 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -306,12 +306,11 @@ class mail_message(osv.Model): def unlink(self, cr, uid, ids, context=None): # cascade-delete attachments that are directly attached to the message (should only happen - # for mail.messages that act as parent for a standalone mail.mail record). Also remove - # attachment with a void id, because this can happen with the composer. + # for mail.messages that act as parent for a standalone mail.mail record). attachments_to_delete = [] for message in self.browse(cr, uid, ids, context=context): for attach in message.attachment_ids: - if attach.res_model == self._name and (attach.res_id == message.id or attach.res_id == 0): + if attach.res_model == self._name and attach.res_id == message.id: attachments_to_delete.append(attach.id) if attachments_to_delete: self.pool.get('ir.attachment').unlink(cr, uid, attachments_to_delete, context=context)