[IMP] mail.compose.message: cascade delete attachments upon vacuum-clean

bzr revid: odo@openerp.com-20120824112312-zs5raruc4qdprlnp
This commit is contained in:
Olivier Dony 2012-08-24 13:23:12 +02:00
parent 18f6fd8990
commit f4c2bd121f
2 changed files with 7 additions and 2 deletions

View File

@ -220,7 +220,7 @@ class mail_message(osv.Model):
for notification in not_obj.browse(cr, uid, not_ids, context=context):
if notification.message_id.id in ids:
pass
# FO Note: we should put this again !!!
# FP Note: we should put this again !!!
#ids.remove(notification.message_id.id)
# check messages according to related documents

View File

@ -19,7 +19,6 @@
#
##############################################################################
import ast
import re
import tools
@ -281,6 +280,12 @@ class mail_compose_message(osv.TransientModel):
return tools.ustr(result)
return template and EXPRESSION_PATTERN.sub(merge, template)
def unlink(self, cr, uid, ids, context=None):
# Cascade delete all attachments, as they are owned by the composition wizard
for wizard in self.read(cr, uid, ids, ['attachment_ids'], context=context):
self.pool.get('ir.attachment').unlink(cr, uid, wizard['attachment_ids'], context=context)
return super(mail_compose_message,self).unlink(cr, uid, ids, context=context)
def dummy(self, cr, uid, ids, context=None):
""" TDE: defined to have buttons that do basically nothing. It is
currently impossible to have buttons that do nothing special