From e55fd50cb5a1edf14ea4af1b9cd502367fcfd159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 13 Jun 2014 16:32:08 +0200 Subject: [PATCH] [FIX] product_email_template: fixed a bug preventing from sending emails and therefore from validating invoices when having templates without attachments linnked to a product. --- addons/product_email_template/models/invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product_email_template/models/invoice.py b/addons/product_email_template/models/invoice.py index d9e82e42012..d5876b510f1 100644 --- a/addons/product_email_template/models/invoice.py +++ b/addons/product_email_template/models/invoice.py @@ -27,7 +27,7 @@ class account_invoice(osv.Model): template_values = Composer.onchange_template_id( cr, uid, composer_id, line.product_id.email_template_id.id, 'comment', 'account.invoice', invoice.id )['value'] - template_values['attachment_ids'] = [(4, id) for id in template_values.get('attachment_ids', '[]')] + template_values['attachment_ids'] = [(4, id) for id in template_values.get('attachment_ids', [])] Composer.write(cr, uid, [composer_id], template_values, context=context) Composer.send_mail(cr, uid, [composer_id], context=context) return True