Merge branch 'shreyasp-matl-req-non-stock-item' into develop
This commit is contained in:
commit
1dd6329e5b
@ -127,14 +127,18 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
|
||||
method: "erpnext.manufacturing.doctype.bom.bom.get_bom_items",
|
||||
args: values,
|
||||
callback: function(r) {
|
||||
$.each(r.message, function(i, item) {
|
||||
var d = frappe.model.add_child(cur_frm.doc, "Material Request Item", "items");
|
||||
d.item_code = item.item_code;
|
||||
d.description = item.description;
|
||||
d.warehouse = values.warehouse;
|
||||
d.uom = item.stock_uom;
|
||||
d.qty = item.qty;
|
||||
});
|
||||
if(!r.message) {
|
||||
frappe.throw(__("BOM does not contain any stock item"))
|
||||
} else {
|
||||
$.each(r.message, function(i, item) {
|
||||
var d = frappe.model.add_child(cur_frm.doc, "Material Request Item", "items");
|
||||
d.item_code = item.item_code;
|
||||
d.description = item.description;
|
||||
d.warehouse = values.warehouse;
|
||||
d.uom = item.stock_uom;
|
||||
d.qty = item.qty;
|
||||
});
|
||||
}
|
||||
d.hide();
|
||||
refresh_field("items");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user