mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
[Fix] Show a message while user tries to create Material request with BOM which contains only non-stock item
This commit is contained in:
@@ -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");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user