Address Template Not Applying to Print Format

Hi there,

I’m working on updating my Print Format Templates and I did not like the way the Customer Address was formatting, basically one item per line as in:

Address 1
Address 2
Postal Code (called Pincode in ERPNext, aka Zip Code in US)

I went into the Address Template section and made my changes so that address is now formatted as:
Address 1
Address 2
City, State, Pincode

and it is reflected when I look at the customer, however, my print template does not seem to be picking up the change, even after a reload.

Customer Screenshot (as it should be formatted):

How it’s showing (the previous template layout) in my Print Format:

Any thoughts on what I’m missing here? Potential bug?

Looks like it now works on NEW invoices, however, even editing an old invoice, it stays in the old format.

So, to reproduce on production, with default settings… create a sales invoice and hit save (do not hit submit)
Go to your address templates and make changes / set the default.
Go back to your invoice, edit something and then attempt to look at the print preview again… should still show in the old format.
Go to a new invoice, create a new invoice, hit save (but not submit) and it should now show with the correct format in print preview.

Since I haven’t submitted the invoice yet and because the print format, i think, would look up the format from the address template, not from the database, it appears to be a slight bug… but perhaps once the customer info get saved to an invoice, it saves the template format to that invoice, so that even if you change the template later, it does not overwrite. Perhaps an easy solution would be to make sure to re-save the current address template to the database each time one is saved/submitted, rather than just on first save (as it appears to do now).

I found similar experiences to you. It does work and us quite powerful but only works with newly submitted doctypes. In some ways this is correct as you don’t want to change previously submitted things