Hi There,
Is there a file where I can directly edit-in-place a custom print format other than the the provided Web Editor? I am having issues saving my changes and also it would be a nicer experience doing the changes in an IDE. The saving problem takes place at random, where my small changes get lost when pressing the save button. I tried working with the exported customization in my custom app’s “print_format” directory but the exported format contains character escaping plus Python’s Unicode text representation (\u) for non-ascii languages. Any advice is really appreciated.
It’s Possible first create a custom module then module set in custom app after that create a print format in custom module.
when you create a print format and save it then automatically print format add in custom app path like: custom_app/custom_app/custom_app/print_format/your_print_format_folder/your_print_format.json
I created a print format named “A4” and after “bench migrate” I was able to see it listed in the sales invoice print format drop down". The content of “a4.html” is:
{{doc.name}}
{{doc.customer_name}}
My custom app custom_print’s dir structure is as follow:
the content of my print format’s JSON (a4.json) file is:
If I do it from the UI it works just fine but it’s not picking up my changes in the .html file. I did both bench migrate and bench restart with no luck.
What are you working steps?
Here is how I did it:
From Print Format list view, I click “+Add Print Format”
“Name” to “A4”
“Standard” to “Yes”
“DocType” to “Sales Invoice”
“Custom Format” to “Checked”
“Module” to “Test” (my module)
“Print Fromat Type” to “Jinja”
“HTML” to Sample jinja like “{{doc.name}}”
From my custom app print_format’s directory, I set “html”: “” in the “a4.json” and create “a4.html” with my custom text.
Lastly I execute “bench migrate” & " bench stop/start"