Print Field from another Document

Hello,
I want to print Supplier Code with Supplier Name in Purchase Order. I had tried using the ones alloted from Naming Series but I was unable to print it in custom format.

Now, I have entered Supplier code in Supplier details on Supplier form.

Can someone please tell me why is my syntax wrong ?
{{ frappe.db.get_value(“Supplier”, supplier_name, “supplier_details”) }}

I am getting same supplier details for all Purchase Orders.

Share screenshots, This looks like a simple fetch from issue, I cannot exactly understand the exact use case. Share screenshots of the exact fields and where you want to fetch them

1 Like

Thanks, I have solved the problem now. The fetch was not working. So, I created a new custom field “Supplier Code” on Supplier and fetched the same from Supplier doctype to Purchase Order and then used the same to print on the print format.

Thanks alot for your response.

You can pass reference of your purchase order as a filter to fetch suppler for that particular purchase order