Printing and pdf generating problem, outputs {{body}} file

Hi, today printing started to fail, it generates pages with only text
{{body}}

Trying to generate PDF, it generates the same pdf, however Print Preview, that is generated before hand shows correct. (When I mean Print Preview, I mean when you click the Printer icon on the top right)

Has anybody experienced similiar problem?

I disabled the custom print formats that worked, for more than 2 months and with the standard print format this error occurs also

Since yesterday I have been having the same problem. v12.3.1 && v12.4.0
For each document to be printed or generated in pdf it displays only {{body}}. We haven’t made any changes in the past few months. Help!

This may be because of some of the built in functions that you are using in your print format are no longer part of the alowed functions. There was a change, but i don’t know if it affects this.

I’ve deleted all my print format However, the problem persists.

The problem is in that particular print format.

Sorry but I’does not understand. My problem is in all print format, on all docTypes
I’ve deleted my print formats, I’ve deleted my print settings and print style… also removed term and conditions.
No luck always output {{ body }} :cry::sob:

I’ve changed the naming series, could it have generate the problem in some how?

1 Like

Yesterday, I had the same issue in my custom print format, I wanted to print creation date on my document so I tried this

Creation On: {{ doc.creation }}

this one run perfectly but this also print time of creation so I tried this

Creation On : {{ doc.creation.split(’ ')[0] }}

but after applying the split function for only get date, This Line print preview was perfect but in print PDF option was the same as yours {{ body }}… I try so many thing to figure out this issue finally I get it that new version give us doc.creation field as a DATETIME OBJECT not a STRING so in preview mode it convert automatically into string but in PDF generating this giving ERROR so I try this

Creation On : {{ (‘%s’%(doc.creation)).split(’ ')[0] }}

this last one work perfectly and get rid of “{{ body }}” in PDF generating.

I hope this will help u in your issue also… :slightly_smiling_face:

1 Like

@CTH_ERP i have the same issue, can explain more how to doing this? where I must put this code?
thank you

In my print format, I want to add some data but in new version, they have changed doc fields into their field type. In earlier version all field(variable) have in string form but in new version, they have changed into their field type like creation field is datetime fieldtype so U cann’t treat creation field now as String because it change into datetime so if u want creation field as a string so u need to convert it into string like I did in my code…
“%s”%(creation)
this is code can convert any field into string by force because every object have a str() function that can convert any object into string… this is code call that function implicitly…

posting_date have date field type so it’s a date object
posting_time have time field type so it’s a time object

if u want to treat them as a string, first u need to convert them into string…
I hope, this will help u to understand… :slightly_smiling_face:

it’s not only custom print format, all standard format also generates {{ body }} only text, it happen after updating to the newest version.
I don’t understand how to fix it

Installed Apps

ERPNext: v12.4.3 (version-12)
Frappe Framework: v12.2.1 (version-12)
wkhtmltopdf 0.12.5 (with patched qt)

I can fix this issue, if u want to fix this issue and want me to fix this issue, u can place an order or request to my fiverr gig, given below
https://www.fiverr.com/share/DBW7eQ
for this issue Basic package is right.

linking to answer

1 Like

Referring to he post solved my issue.

This worked for me. I just added hostname in site_config.json file.

Thanks man :clap: