diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2019-12-03 07:50:22 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2019-12-03 07:55:13 +0000 |
| commit | 56ee149f113d2632e316d227d04bd5bc5d64bbe9 (patch) | |
| tree | 2396b357a4e9cc54696f3a843e1f00138bcf7b20 | |
| parent | 2554d197ff1d8c53d26e21750c758dc639564a8b (diff) | |
[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>
| -rw-r--r-- | addons/product_email_template/models/account_move.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/product_email_template/models/account_move.py b/addons/product_email_template/models/account_move.py index 339347e1a28..62c2eab7b6c 100644 --- a/addons/product_email_template/models/account_move.py +++ b/addons/product_email_template/models/account_move.py @@ -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): |
