Get field value from internal linked documents in Print Format

Hi folks,

I created a custom Print Format for Purchase Receipt which linked to a Material Request. However, I could not fetch the Material Request name into Purchase Receipt Print Format. They are internal linked and I could not find a way to find the linked field. I tried this {{ frappe.get_doc(‘Material Request’, doc.purchase_receipt).name }} but it seems to fetch the first found Material Request document which is not the one that linked to desired Purchase Receipt.

Any help will be much appreciated!!!

Hi @nguyenth,

It’s already available on the purchase receipt table.

Thank You!

Thanks NCP for helping,

So it seems like it belongs to a child table in Purchase Receipt, I tried these but did not work:
{% for row in doc.purchase_receipt_details %}{{ row.material_request }} {% endfor %}
{% for row in doc.purchase_receipt_item %}{{ row.material_request }} {% endfor %}

Please apply it.

{% for row in doc.items %}
    {{ row.material_request }}
{% endfor %}

Then reload and check it.

Thank You!

It worked, thanks @NCP