[IMP] mail.compose.message: copied attachments in mass mail mode are linked to the composer, because message_post will update their model and res_id.

bzr revid: tde@openerp.com-20130306161151-gczob78pmt683kw7
This commit is contained in:
Thibault Delavallée 2013-03-06 17:11:51 +01:00
parent b1b3ed971a
commit 40244df4c1
1 changed files with 1 additions and 1 deletions

View File

@ -214,7 +214,7 @@ class mail_compose_message(osv.TransientModel):
post_values['attachments'] = email_dict.pop('attachments', [])
attachment_ids = []
for attach_id in post_values.pop('attachment_ids'):
new_attach_id = ir_attachment_obj.copy(cr, uid, attach_id, {'res_model': active_model_pool_name, 'res_id': res_id}, context=context)
new_attach_id = ir_attachment_obj.copy(cr, uid, attach_id, {'res_model': self._name, 'res_id': wizard.id}, context=context)
attachment_ids.append(new_attach_id)
post_values['attachment_ids'] = attachment_ids
post_values.update(email_dict)