From 11a2a2a3c1a67ed3bc3d263448e5ed3e2b7839f9 Mon Sep 17 00:00:00 2001 From: Saif Ur Rehman Date: Fri, 25 Oct 2019 00:50:23 +0500 Subject: [PATCH] fix(printview): Make before_print hookable --- frappe/www/printview.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frappe/www/printview.py b/frappe/www/printview.py index efdd613b19..4853bf1cb9 100644 --- a/frappe/www/printview.py +++ b/frappe/www/printview.py @@ -84,8 +84,7 @@ def get_rendered_template(doc, name=None, print_format=None, meta=None, if doc.docstatus==2 and not cint(print_settings.allow_print_for_cancelled): frappe.throw(_("Not allowed to print cancelled documents"), frappe.PermissionError) - if hasattr(doc, "before_print"): - doc.before_print() + doc.run_method("before_print") if not hasattr(doc, "print_heading"): doc.print_heading = None if not hasattr(doc, "sub_heading"): doc.sub_heading = None