Files
odoo_source/addons/mail/models
Adrian Torres a094095ef3 [IMP] mail: check if template can be rendered on write (#20834)
* [IMP] mail: check if template can be rendered on write

Before this commit, whenever a user would send an email from a template
containing mako python expressions and those expressions contained
syntax errors, the mail would still be sent but the body would be empty,
this was intended behavior but due to an increase in complaints of empty
mails being sent, the behavior was reviewed.

This commit improves on this behavior by:

    1. Rendering the template on write (save)
    2. Checking if the template rendered successfully
    3. Raising a UserError if the rendering failed

The end result is a modal box showing an error to the user whenever he
either saves an mail.template with python syntax error in mako snippers
or when a mail with mako snippets is rendered on-the-fly (wizard).
2018-01-26 16:02:24 +01:00
..
2018-01-19 11:37:51 +01:00