Skip to content

Commit c51da58

Browse files
committed
[FIX] readability
1 parent 4ffe344 commit c51da58

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

email_template_qweb/models/mail_template.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,18 @@ def generate_email(self, res_ids, fields):
3636
not fields or "body_html" in fields
3737
):
3838
record = self_with_lang.env[self_with_lang.model].browse(res_id)
39+
result_resId = result[res_id]
3940
body_html = IrQweb._render(
4041
self_with_lang.body_view_id.id,
4142
{"object": record, "email_template": self_with_lang},
4243
)
4344
body_html = tools.ustr(body_html)
44-
result[res_id][
45-
"body_html"
46-
] = self_with_lang._render_template_postprocess(
45+
rendered_post_temp = self_with_lang._render_template_postprocess(
4746
{res_id: body_html}
48-
)[
49-
res_id
50-
]
51-
result[res_id]["body"] = tools.html_sanitize(
52-
result[res_id]["body_html"]
47+
)
48+
result_resId["body_html"] = rendered_post_temp[res_id]
49+
result_resId["body"] = tools.html_sanitize(
50+
result_resId["body_html"]
5351
)
5452

5553
return result if multi_mode else result[res_ids[0]]

0 commit comments

Comments
 (0)