diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js index aff76eb50f..eb4d0ca24d 100644 --- a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js +++ b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js @@ -57,6 +57,18 @@ frappe.ui.form.on('Subcontracting Receipt', { filters: { 'company': frm.doc.company } }; }); + + frappe.db.get_single_value('Buying Settings', 'backflush_raw_materials_of_subcontract_based_on').then(val => { + if (val == "Material Transferred for Subcontract") { + cur_frm.fields_dict['supplied_items'].grid.grid_rows.forEach((grid_row) => { + grid_row.docfields.forEach((df) => { + if (df.fieldname == "consumed_qty") { + df.read_only = 0; + } + }); + }); + } + }); }, refresh: (frm) => {