How to Fetch item name and Quantity from Purchase Order

Hi All,

I am creating an New App Called “GatePass”
Added New Field “item From PO” and link with Purchase Order. Now i want to fetch only item name and Qty from Selected Purchase Order.? How to fetch item name and Qty from Selected Purchase Order.

Hi @dineshpanchal432

You need to write frappe.call on the trigger of PO, and call the py method to get the po items and append on the current form. For reference see below files


JS Code
https://github.com/frappe/erpnext/blob/develop/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js#L42-L57


PY Code
https://github.com/frappe/erpnext/blob/develop/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py#L15-L71

Check also this topic for qty: I need to clearify my Inventory Quantity - #4 by nabinhait