Referencing Sales Order from Sales Invoice


I’m trying to access the Customer’s Purchase Order po_no in Sales Order from the Sales Invoice through frappe.db.get_value(“Sales Order”, “???” , “po_no”), but the question is i’m not sure what to put in the ??? from the Sales Invoice doc that is tied to the Sales Order.

Can someone assist what field in the Sales Invoice Doctype I can use to tie back to the Sales Order?

Thank you.



Not a API wonk by any means. The docs suggest it might be the SO number?