V15: How to override attach_print and or get_pdf

Hi all,

How can i override attach_print or get_pdf from frappe/frappe/init.py file ???

@Helio_Jesus try like this

import frappe
from my_app.overrides.attach_print_override import custom_attach_print
frappe.attach_print = custom_attach_print

reference : Monkey patch customization - ignored path from hooks.py

Hi.
Thanks but i actually looking for something like override_whitelisted_methods to override whenever attach_print or get_pdf was called…

For my need i just overrided using custom email_queue.py as is the one calling attach_print when you send the Email.

Hi,
Unfortunately for some reason my get_print does not get the REPORT… So i had tried also he Monkey patch like this

import frappe
import aoerp_tools.util.pdf_aoerp
frappe.get_pdf = aoerp_tools.util.pdf_aoerp.get_pdf

And this was placed under init.py of my custom app and still not working…

Actually, after testing and doing this fix

import frappe.utils.pdf
frappe.utils.pdf.get_pdf = aoerp_tools.util.pdf_aoerp.get_pdf

Seems to work… Now testing on my Production.