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

@ -56,7 +56,7 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
if(doc.material_request_type === "Purchase")
cur_frm.add_custom_button(__("Supplier Quotation"),
this.make_supplier_quotation, __("Make"));
if(doc.material_request_type === "Manufacture" && doc.status === "Submitted")
cur_frm.add_custom_button(__("Production Order"),
this.raise_production_orders, __("Make"));
@ -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");
}
@ -162,7 +166,7 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
run_link_triggers: true
});
},
make_request_for_quotation: function(){
frappe.model.open_mapped_doc({
method: "erpnext.stock.doctype.material_request.material_request.make_request_for_quotation",