diff --git a/frappe/www/printview.py b/frappe/www/printview.py index ee0f0869a8..b50624146c 100644 --- a/frappe/www/printview.py +++ b/frappe/www/printview.py @@ -162,7 +162,13 @@ def get_rendered_template( def get_template_from_string(): return jenv.from_string(get_print_format(doc.doctype, print_format)) - if print_format.custom_format: + template = None + if hook_func := frappe.get_hooks("get_print_format_template"): + template = frappe.get_attr(hook_func[-1])(jenv=jenv, print_format=print_format) + + if template: + pass + elif print_format.custom_format: template = get_template_from_string() elif print_format.format_data: