@rmehta
I have managed to get it to work by changing onload to refresh. What is the difference between the two?
frappe.ui.form.on("Purchase Order", "refresh", function(frm) {
cur_frm.set_query("supplier", function() {
return {
"filters": {
"currency_pay_in": "USD"
}
};
});
});