I am working with ERPNext v15.67.0 and Healthcare v15.1.3, and I have a requirement related to printing behavior in the Sales Invoice doctype.
Normally, when a user opens a Sales Invoice and clicks the Print icon, ERPNext shows all available print formats for the user to choose from.
However, in my use case, I need ERPNext to automatically select a specific print format based on certain conditions inside the invoice.
For example:
-
If Condition A is true → use Print Format A
-
If Condition B is true → use Print Format B
-
If Condition C is true → use Print Format C
The goal is that when the user presses the Print button, the system should directly open the print preview with the correct print format applied, without requiring the user to manually choose from the dropdown.
So my question is:
In ERPNext v15.67.0, is there any default or built-in method to dynamically select and apply a print format automatically when clicking the Print icon in a Sales Invoice, based on document conditions?