fix(printview): Make before_print hookable (#8684)

This commit is contained in:
Faris Ansari 2019-10-26 18:58:53 +05:30 committed by GitHub
commit f40a2e253f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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