Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] mail: better mail template user error
To reproduce: Introduce some error in a mail template. For instance: `% set bug = object.not_exiting_function()` Before this commit: The user message is confusing with irrelevant information. In my example case: ``` Failed to render template <Template memory:7f76f424b2b0> using values {'format_date': <function MailTemplate.render_template.<locals>.<lambda> at 0x7f76e9422d08>, 'format_tz': <function MailTemplate.render_template.<locals>.<lambda> at 0x7f76e9422840>, 'format_amount': <function MailTemplate.render_template.<locals>.<lambda> at 0x7f76e9422950>, 'user': res.users(1,), 'ctx': {'lang': 'en_US', 'tz': 'Europe/Brussels', 'uid': 1, 'type': 'out_invoice', 'journal_type': 'sale', 'params': {'action': 198}, 'active_model': 'account.invoice', 'active_id': 3, 'active_ids': [3], 'default_model': 'account.invoice', 'default_res_id': 3, 'default_use_template': True, 'default_template_id': 7, 'default_composition_mode': 'comment', 'mark_invoice_as_sent': True, 'custom_layout': 'account.mail_template_data_notification_email_account_invoice', 'force_email': True, 'search_disable_custom_filters': True, 'tpl_partners_only': True, 'safe': False}, 'object': account.invoice(3,)} ``` After this commit: More relevant information are added to the logs and user message. In my example case: `UndefinedError: 'odoo.api.account.invoice object' has no attribute 'not_exiting_function'` OPW-2266567 closes odoo#52417 X-original-commit: 6ae9c09 Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
- Loading branch information