I’m trying to share my modification in printing as configurable option for everyone (contribute to ERPNext, so anyone can use it).
The problem is that “Print Settings” docType is part of frappe/frappe repo, and print_setting.py controller deciding what will be printed is in frappe/erpnext repo.
For consistency reason, I would like to make changes only in erpnext.
If I add checkbox directly in frappe, it will be visible for every frappe user, even not using erpnext. So it’s not good solution.
In heavy details:
print_setting.py controller sets:
doc.print_templates = { “qty”: “templates/print_formats/includes/item_table_qty.html” }
I want to make it optional and if some option is checked in Print Settings (let’s call it “Swap UOM and quantity”), other file will be used as qty template. For example:
if swap_uom_and_quantity != 1:
doc.print_templates = { “qty”: “templates/print_formats/includes/item_table_qty.html” } # standard
else:
doc.print_templates = { “qty”: “templates/print_formats/includes/item_table_qty_swapped.html” } # alternative
So I added a checkbox in Print Settings, so user can switch alternative version on or off. And it works. But now checkbox is visible even if erpnext is not installed, so it has no sense.
Do you have any idea how to solve it?