Skip to content
Snippets Groups Projects
Commit c269d96e authored by Dharmraj Jhala's avatar Dharmraj Jhala Committed by Thibault Delavallée
Browse files

[FIX] sms: prevent crash when previewing template without records


This commit fixes the traceback while previewing SMS template when there
are no records available.

TaskID 2180132
PR #44080

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent 65d77b71
No related branches found
No related tags found
No related merge requests found
......@@ -53,4 +53,4 @@ class SMSTemplatePreview(models.TransientModel):
self.res_id = self.resource_ref.id
if self.sms_template_id:
template = self.sms_template_id.with_context(lang=self.lang)
self.body = template._render_template(template.body, template.model, self.res_id or 0)
self.body = template._render_template(template.body, template.model, self.res_id or 0) if self.resource_ref else template.body
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment