Skip to content
Snippets Groups Projects
Commit 52afa5e3 authored by Christophe Simonis's avatar Christophe Simonis
Browse files

[FIX] email_template: avoid double extension for report attachement

bzr revid: chs@openerp.com-20100806094411-rg9vx3ysnfwaeyji
parent cc429ca2
Branches
Tags
No related merge requests found
......@@ -468,18 +468,18 @@ class email_template(osv.osv):
data,
context)
attachment_obj = self.pool.get('ir.attachment')
fname = tools.ustr(get_value(cursor, user, record_id,
template.file_name, template, context)
or 'Report')
ext = '.' + format
if not fname.endswith(ext):
fname += ext
new_att_vals = {
'name':mail.subject + ' (Email Attachment)',
'datas':base64.b64encode(result),
'datas_fname':tools.ustr(
get_value(
cursor,
user,
record_id,
template.file_name,
template,
context
) or 'Report') + "." + format,
'datas_fname': fname,
'description':mail.subject or "No Description",
'res_model':'email_template.mailbox',
'res_id':mail.id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment