[FIX] base: add mimetype for url attachment

This commit is contained in:
Christophe Matthieu
2016-01-11 10:17:19 +01:00
parent fa1e30394e
commit 12f97e5242
+2
View File
@@ -248,6 +248,8 @@ class ir_attachment(osv.osv):
mimetype = 'application/octet-stream'
if values.get('datas_fname'):
mimetype = mimetypes.guess_type(values['datas_fname'])[0]
if values.get('url'):
mimetype = mimetypes.guess_type(values['url'])[0]
if values.get('datas') and (not mimetype or mimetype == 'application/octet-stream'):
mimetype = guess_mimetype(values['datas'].decode('base64'))
return mimetype