Custom HTML - Header / Address template

Hey guys!

I have problems with the custom HTML print format for my sales invoice.
Im able to set my header on the first page with:

{{ add_header(0,1,doc,letter_head, no_letterhead) }}

But it’s not shown on the following pages. How is it possible to do this in custom HTML?

Also i want to customize the address, so I changed the address template and set it to isDefault . But my document still shows the “default” template. Did I forgot something? In HTML I get the address with:

{{ doc.address_display or ‘’ }}

And my address template:

{{ address_line1 }}
{% if address_line2 %}{{ address_line2 }}
{% endif -%}
{% if pincode %}{{ pincode }} {% endif -%}{{ city }}
{{ country }}{% if state %} - {{ state }}{% endif -%}

Thanks for your support!

@Fuser123 Do you have any solutions?
I’m also have the same problem.

Templates are used while rendering the address fields in documents, and changes in the template won’t be reflected in documents created earlier. Please try creating a new Invoice and see if your changes work.


1 Like

It’s like what you said.
Thank you so much!

@akurungadam I think you are referring to fields he had created early for addresses. For fields recently created, old docs will not get it reflected in print format, because they dont have data in their fields in doc object which is right.

But @Fuser123 was also talking about header where he was referring that he has set a header which is not reflecting in second page.

@Fuser123 did you sent the header in Print format or as letter head.

Can you paste your Jinja Template Please ?