[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.

This commit is contained in:
Thibault Delavallée 2014-06-13 16:32:08 +02:00
parent cd95dc1a8f
commit e55fd50cb5
1 changed files with 1 additions and 1 deletions

View File

@ -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