[FIX] mail: force attachment type

Do not rely on default value. The context can contains a `default_type`
value intended for another model.
This commit is contained in:
Christophe Simonis
2017-08-09 14:06:13 +02:00
parent 3d119c44f3
commit baca743cc0
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -549,6 +549,7 @@ class MailTemplate(models.Model):
'name': attachment[0],
'datas_fname': attachment[0],
'datas': attachment[1],
'type': 'binary',
'res_model': 'mail.message',
'res_id': mail.mail_message_id.id,
}
+1
View File
@@ -1609,6 +1609,7 @@ class MailThread(models.AbstractModel):
data_attach = {
'name': name,
'datas': base64.b64encode(str(content)),
'type': 'binary',
'datas_fname': name,
'description': name,
'res_model': attach_model,