diff --git a/frappe/templates/print_formats/standard_macros.html b/frappe/templates/print_formats/standard_macros.html index b3c2059887..6fb0ba3da5 100644 --- a/frappe/templates/print_formats/standard_macros.html +++ b/frappe/templates/print_formats/standard_macros.html @@ -1,7 +1,7 @@ {% macro render_field(df, doc) -%} {%- if df.fieldtype=="Table" -%} {{ render_table(df, doc) }} - {%- elif df.fieldtype=="HTML" -%} + {%- elif df.fieldtype=="HTML" and df.options -%}
{{ frappe.render_template(df.options, {"doc": doc}) or "" }}
{%- elif df.fieldtype in ("Text", "Text Editor", "Code") -%} {{ render_text_field(df, doc) }} diff --git a/frappe/utils/jinja.py b/frappe/utils/jinja.py index 2330b09b33..1fd9a0d85c 100644 --- a/frappe/utils/jinja.py +++ b/frappe/utils/jinja.py @@ -57,6 +57,9 @@ def render_template(template, context, is_path=None): :param context: dict of properties to pass to the template :param is_path: (optional) assert that the `template` parameter is a path''' + if not template: + return "" + # if it ends with .html then its a freaking path, not html if (is_path or template.startswith("templates/")