[FIX] problem of corrupted pdf when sending email from email-template.
authorPedro M. Baeza <pedro.baeza@serviciosbaeza.com>
Fri, 20 Jun 2014 07:05:47 +0000 (07:05 +0000)
committerStefan Rijnhart <stefan@therp.nl>
Wed, 2 Jul 2014 17:44:49 +0000 (19:44 +0200)
addons/email_template/email_template.py

index 30417ac..c1c1b0a 100644 (file)
@@ -341,7 +341,8 @@ class email_template(osv.osv):
             service = netsvc.LocalService(report_service)
             (result, format) = service.create(cr, uid, [res_id], {'model': template.model}, ctx)
             # TODO in trunk, change return format to binary to match message_post expected format
-            result = base64.b64encode(result)
+            if not ctx['default_composition_mode'] == 'mass_mail':
+                result = base64.b64encode(result)
             if not report_name:
                 report_name = report_service
             ext = "." + format