Merge pull request #50856 from rohitwaghchaure/fixed-operation-read-only

fix: not able to set operation in work order
This commit is contained in:
rohitwaghchaure
2025-12-02 12:22:46 +05:30
committed by GitHub
2 changed files with 10 additions and 3 deletions

View File

@@ -244,7 +244,13 @@ frappe.ui.form.on("Work Order", {
},
toggle_items_editable(frm) {
frm.toggle_enable("required_items", frm.doc.__onload?.allow_editing_items === 1 ? 1 : 0);
if (!frm.doc.__onload?.allow_editing_items) {
frm.set_df_property("required_items", "cannot_delete_rows", true);
frm.set_df_property("required_items", "cannot_add_rows", true);
frm.fields_dict["required_items"].grid.update_docfield_property("item_code", "read_only", 1);
frm.fields_dict["required_items"].grid.update_docfield_property("required_qty", "read_only", 1);
frm.fields_dict["required_items"].grid.refresh();
}
},
hide_reserve_stock_button(frm) {

View File

@@ -160,7 +160,8 @@
"fieldname": "stock_uom",
"fieldtype": "Link",
"label": "Stock UOM",
"options": "UOM"
"options": "UOM",
"read_only": 1
},
{
"fieldname": "section_break_idhr",
@@ -206,7 +207,7 @@
"grid_page_length": 50,
"istable": 1,
"links": [],
"modified": "2025-10-12 14:27:16.721532",
"modified": "2025-12-02 11:16:05.081613",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Work Order Item",