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,14 +127,18 @@ 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) {
$.each(r.message, function(i, item) { if(!r.message) {
var d = frappe.model.add_child(cur_frm.doc, "Material Request Item", "items"); frappe.throw(__("BOM does not contain any stock item"))
d.item_code = item.item_code; } else {
d.description = item.description; $.each(r.message, function(i, item) {
d.warehouse = values.warehouse; var d = frappe.model.add_child(cur_frm.doc, "Material Request Item", "items");
d.uom = item.stock_uom; d.item_code = item.item_code;
d.qty = item.qty; d.description = item.description;
}); d.warehouse = values.warehouse;
d.uom = item.stock_uom;
d.qty = item.qty;
});
}
d.hide(); d.hide();
refresh_field("items"); refresh_field("items");
} }