Erpnext print format

How to get purchase order id in purchase receipt print by using jinja template?

{{ doc.name }}

{{ doc.name }} gives purchase receipt id.
I need Purchase order details in purchase receipt. How?

can you show me the Details i couldnt give a correct answer withoout correct detaiils


Here i need to display Purchase order id in PO.

Please show me the field
we can use {{doc.fieldname}}

Actually Purchase order details not in puchase receipt doctype. We have to fetch it from connections.


Here you can fetch the field from purchase order by creating same name to the field in purchase receipt after that you can fetch it from the purchase receipt to print

Can you provide code snippet for fetching in jijnja?

First to get the purchase order details in Print you need to fetch purchase order details from purchase order to purchase receipt

After that you need to give it like {{ doc.fieldname }} in print Format

How to fetch purchase order details from purchase order to purchase receipt

which field you want from purchase order can you show me that field

@Jeemon_George purchase order field is located in the item level . so each item has it’s own purchase order. so try this {{doc.items[0].purchase_order}} .

ok. thank you