summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2012-09-07 13:54:22 +0200
committerThibault Delavallée <tde@openerp.com>2012-09-07 13:54:22 +0200
commit910bc5f00a5ad4838cc3c2693dfd097134921a2f (patch)
tree841cb88a783bebc4b3083f6750bf70742ae44b01
parent07663470e5dda3ef0c61912590286fa6992f8aab (diff)
[REV] Reverted hack about attachments, that was not good.
bzr revid: tde@openerp.com-20120907115422-zfynv8pdsxk5p3vg
-rw-r--r--addons/mail/mail_message.py5
1 files 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)