[FIX] product_email_template: use proper parameters

`custom_layout` should be set as a context key, otherwise it crashes at
creation because of non-existing field.

opw-2146695
opw-2149726

closes odoo/odoo#41238

X-original-commit: f9837eb08a316965057fe239f434b1c6d5c0196c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2019-12-03 07:55:13 +00:00
parent 2554d197ff
commit 56ee149f11
@@ -14,7 +14,9 @@ class AccountMove(models.Model):
invoice.message_subscribe([invoice.partner_id.id])
for line in invoice.invoice_line_ids:
if line.product_id.email_template_id:
invoice.message_post_with_template(line.product_id.email_template_id.id, composition_mode='comment', custom_layout='mail.mail_notification_light')
invoice.with_context(custom_layout="mail.mail_notification_light").message_post_with_template(
line.product_id.email_template_id.id, composition_mode="comment"
)
return True
def post(self):