Merge branch 'shreyasp-matl-req-non-stock-item' into develop

This commit is contained in:
Anand Doshi 2016-04-08 16:32:30 +05:30
commit 1dd6329e5b

View File

@ -127,6 +127,9 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
method: "erpnext.manufacturing.doctype.bom.bom.get_bom_items", method: "erpnext.manufacturing.doctype.bom.bom.get_bom_items",
args: values, args: values,
callback: function(r) { callback: function(r) {
if(!r.message) {
frappe.throw(__("BOM does not contain any stock item"))
} else {
$.each(r.message, function(i, item) { $.each(r.message, function(i, item) {
var d = frappe.model.add_child(cur_frm.doc, "Material Request Item", "items"); var d = frappe.model.add_child(cur_frm.doc, "Material Request Item", "items");
d.item_code = item.item_code; d.item_code = item.item_code;
@ -135,6 +138,7 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
d.uom = item.stock_uom; d.uom = item.stock_uom;
d.qty = item.qty; d.qty = item.qty;
}); });
}
d.hide(); d.hide();
refresh_field("items"); refresh_field("items");
} }