fix: not able to set operation in work order

This commit is contained in:
Rohit Waghchaure
2025-12-02 11:18:07 +05:30
committed by Smit Vora
parent 1d36cb55cd
commit 62d58702a0
2 changed files with 8 additions and 2 deletions

View File

@@ -247,7 +247,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();
}
},
add_custom_button_to_return_components: function (frm) {

View File

@@ -151,7 +151,7 @@
],
"istable": 1,
"links": [],
"modified": "2024-11-19 15:48:16.823384",
"modified": "2025-12-02 11:16:05.081613",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Work Order Item",