diff options
| author | Thibault Delavallée <tde@openerp.com> | 2013-02-28 14:26:25 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2013-02-28 14:26:25 +0100 |
| commit | b0eb876160935cede1c9b4ab84ea988f63bbdc55 (patch) | |
| tree | 67d6bc8dcc8a82be82eb424526ef3f38982b0628 /addons/mail/wizard/mail_compose_message.py | |
| parent | be867174aa36475c98dd8ceaa0843c8935d9d2a1 (diff) | |
[FIX] mail: first try to fix attachment duplication.
bzr revid: tde@openerp.com-20130228132625-8yjggruhrvbvep21
Diffstat (limited to 'addons/mail/wizard/mail_compose_message.py')
| -rw-r--r-- | addons/mail/wizard/mail_compose_message.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index ec0c2a8de06..5741aacb449 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -205,13 +205,16 @@ class mail_compose_message(osv.TransientModel): 'body': wizard.body, 'parent_id': wizard.parent_id and wizard.parent_id.id, 'partner_ids': [(4, partner.id) for partner in wizard.partner_ids], - 'attachments': [(attach.datas_fname or attach.name, base64.b64decode(attach.datas)) for attach in wizard.attachment_ids], + 'attachments': [], + 'attachment_ids': [(4, attach.id) for attach in wizard.attachment_ids], } # mass mailing: render and override default values if mass_mail_mode and wizard.model: email_dict = self.render_message(cr, uid, wizard, res_id, context=context) new_partner_ids = email_dict.pop('partner_ids', []) post_values['partner_ids'] += [(4, partner_id) for partner_id in new_partner_ids] + new_attachment_ids = email_dict.pop('attachment_ids', []) + post_values['attachments'] += new_attachment_ids new_attachments = email_dict.pop('attachments', []) post_values['attachments'] += new_attachments post_values.update(email_dict) |
