How to add Custom Script Print Format HTML into Frappe Standard Templates

Hello everyone,

I’m currently working on a script report with a custom print format HTML in my Frappe application. The report consists of two files: my_report.js and my_report.html. While I have successfully created the HTML template, I’m unsure of how to add it to Frappe’s standard templates (frappe.templates).

Could someone please provide guidance on how to seamlessly incorporate my custom print format HTML into Frappe’s standard templates? I want to ensure that it aligns with Frappe’s standards and is easily accessible for future use.

Thank you!

Go to Customize Form View —> Open the document for which the Default print format is to be set (like Sales order) —> Select the Print format in the Default Print format and save.

Do a clear cache to see the selected print format as default.

I found a solution. Just add the HTML file in the public folder and include it in my_bundle.js. Then, include the bundle in hook.py. Finally, migrate, build, and restart. That’s all!

1 Like