I’m working for a company that has created multiple apps for internal use. We have been creating custom Print Formats for native DocTypes in the old fashion: With the html code in the .json. But we think that it would be nice to have those Print Formats as .html files, as it can be done when the Print Format is for a DocType native to the app that has the Print Format.
This will make the Print Formats much more easy to maintain and will not break any existing functionality.
I’ve maked a GitHub issue and a PR for this:
Let me know what do you think and if you have faced the same problem before.
That’s how we are doing it. But working as a team with lots of custom apps and lots of people maintaining them is hard to maintain a jinja template in a .json file (when the Print Format is exported). It will be much nicer to maintain a .html file.
It seems like the intended functionality was to allow the .html Print Format. And it is allowed, but just for DocTypes that are in the same app as the Print Format.
If i have my app “Test App” and i want to create a Print Format for my DocType “Test DocType” i can do it via .html file and we are all happy. But if i want to create a Print Format for, let’s say, “Sales Invoice” (native to ERPNext), i can’t use an .html file and i should use the html field that you mention.
By using the html field, the template is saved in a field of a .json file, all escaped and in one line. This make it impossible to maintain in an easy way (if i want to change it i have to migrate the site, start the site, copy the html field content to a propper code editor, edit it, paste it again in the html field).