Item_code Should come according to supplier

In Purchase Order “item_code” Should be come According to Supplier Name or only that item should come on that link field which belong to that particular supplier

You can set up a supplier code (Stock…Items…Supplier details) as well as your own “internal” code

1 Like

You can set default supplier in the Item master and then add a custom script like this which will trigger on supplier selection:

frappe.ui.form.on('Purchase Order', {
    supplier: function(frm) {
		if (frm.doc.supplier) {
			frm.set_query("item_code", "items", function() {
				return {
					filters: {
						default_supplier: frm.doc.supplier

Thank You so much mam

Code is Working fine

thanks for your reply