fix: add css handling for letterheads for doctype printing
This commit is contained in:
parent
0ab6840d1d
commit
193c2c200f
1 changed files with 8 additions and 2 deletions
|
|
@ -236,6 +236,12 @@ def get_rendered_template(
|
|||
{letter_head.header_script}
|
||||
</script>
|
||||
"""
|
||||
if letter_head.custom_css:
|
||||
letter_head.content += f"""
|
||||
<style>
|
||||
{letter_head.custom_css}
|
||||
</style>
|
||||
"""
|
||||
|
||||
if letter_head.footer:
|
||||
letter_head.footer = frappe.utils.jinja.render_template(letter_head.footer, {"doc": doc.as_dict()})
|
||||
|
|
@ -427,7 +433,7 @@ def get_letter_head(doc: "Document", no_letterhead: bool, letterhead: str | None
|
|||
return frappe.db.get_value(
|
||||
"Letter Head",
|
||||
letterhead_name,
|
||||
["content", "footer", "header_script", "footer_script"],
|
||||
["content", "footer", "header_script", "footer_script", "custom_css"],
|
||||
as_dict=True,
|
||||
)
|
||||
else:
|
||||
|
|
@ -435,7 +441,7 @@ def get_letter_head(doc: "Document", no_letterhead: bool, letterhead: str | None
|
|||
frappe.db.get_value(
|
||||
"Letter Head",
|
||||
{"is_default": 1},
|
||||
["content", "footer", "header_script", "footer_script"],
|
||||
["content", "footer", "header_script", "footer_script", "custom_css"],
|
||||
as_dict=True,
|
||||
)
|
||||
or {}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue