diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 8cf56e1f89..bc722e597e 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -25,11 +25,11 @@ frappe.ui.form.on("Purchase Order", { frm.set_indicator_formatter('item_code', function(doc) { return (doc.qty<=doc.received_qty) ? "green" : "orange" }) - frm.set_query("reserve_warehouse", "supplied_items", function() { + frm.set_query("blanket_order", "items", function() { return { filters: { "company": frm.doc.company, - "is_group": 0 + "docstatus": 1 } } }); diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index c1e790c96a..97c34b077c 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -32,6 +32,15 @@ frappe.ui.form.on("Sales Order", { } }); + frm.set_query("blanket_order", "items", function() { + return { + filters: { + "company": frm.doc.company, + "docstatus": 1 + } + } + }); + erpnext.queries.setup_warehouse_query(frm); }, @@ -444,4 +453,4 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend( }); } }); -$.extend(cur_frm.cscript, new erpnext.selling.SalesOrderController({frm: cur_frm})); \ No newline at end of file +$.extend(cur_frm.cscript, new erpnext.selling.SalesOrderController({frm: cur_frm}));