diff --git a/erpnext/manufacturing/doctype/job_card/job_card.js b/erpnext/manufacturing/doctype/job_card/job_card.js index 95549d5a248..1d9544d34f4 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.js +++ b/erpnext/manufacturing/doctype/job_card/job_card.js @@ -3,6 +3,11 @@ frappe.ui.form.on('Job Card', { refresh: function(frm) { + + if(frm.doc.docstatus == 0) { + frm.set_df_property("operation", "read_only", frm.doc.operation_id ? 1 : 0); + } + if(!frm.doc.__islocal && frm.doc.items && frm.doc.items.length) { if (frm.doc.for_quantity != frm.doc.transferred_qty) { frm.add_custom_button(__("Material Request"), () => { diff --git a/erpnext/manufacturing/doctype/work_order/work_order.js b/erpnext/manufacturing/doctype/work_order/work_order.js index 1951c271548..7e1ea3eb1d9 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.js +++ b/erpnext/manufacturing/doctype/work_order/work_order.js @@ -6,6 +6,7 @@ frappe.ui.form.on("Work Order", { frm.custom_make_buttons = { 'Stock Entry': 'Start', 'Pick List': 'Create Pick List', + 'Job Card': 'Create Job Card', }; // Set query for warehouses @@ -136,7 +137,7 @@ frappe.ui.form.on("Work Order", { if (frm.doc.docstatus === 1 && frm.doc.operations && frm.doc.operations.length - && frm.doc.qty != frm.doc.material_transferred_for_manufacturing) { + && frm.doc.qty != frm.doc.produced_qty) { const not_completed = frm.doc.operations.filter(d => { if(d.status != 'Completed') {