mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
Merge pull request #9699 from manassolanki/productn
frappe call only when there is item in production order
This commit is contained in:
@@ -151,26 +151,28 @@ frappe.ui.form.on("Production Order", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
production_item: function(frm) {
|
production_item: function(frm) {
|
||||||
frappe.call({
|
if (frm.doc.production_item) {
|
||||||
method: "erpnext.manufacturing.doctype.production_order.production_order.get_item_details",
|
frappe.call({
|
||||||
args: {
|
method: "erpnext.manufacturing.doctype.production_order.production_order.get_item_details",
|
||||||
item: frm.doc.production_item,
|
args: {
|
||||||
project: frm.doc.project
|
item: frm.doc.production_item,
|
||||||
},
|
project: frm.doc.project
|
||||||
callback: function(r) {
|
},
|
||||||
if(r.message) {
|
callback: function(r) {
|
||||||
erpnext.in_production_item_onchange = true;
|
if(r.message) {
|
||||||
$.each(["description", "stock_uom", "project", "bom_no"], function(i, field) {
|
erpnext.in_production_item_onchange = true;
|
||||||
frm.set_value(field, r.message[field]);
|
$.each(["description", "stock_uom", "project", "bom_no"], function(i, field) {
|
||||||
});
|
frm.set_value(field, r.message[field]);
|
||||||
|
});
|
||||||
|
|
||||||
if(r.message["set_scrap_wh_mandatory"]){
|
if(r.message["set_scrap_wh_mandatory"]){
|
||||||
frm.toggle_reqd("scrap_warehouse", true);
|
frm.toggle_reqd("scrap_warehouse", true);
|
||||||
|
}
|
||||||
|
erpnext.in_production_item_onchange = false;
|
||||||
}
|
}
|
||||||
erpnext.in_production_item_onchange = false;
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
project: function(frm) {
|
project: function(frm) {
|
||||||
|
|||||||
Reference in New Issue
Block a user