make child table read-only after workflow status changes, from apply to approved. doctype is not submitable. i have 3 step workflow, apply-verify-approved.
so i want to make transaction read only after approved.
i used below code, but when i reload the page it dose-not work. only sometime working
frappe.ui.form.on(“Appraisal Work Plan”, “goals_on_form_rendered”, function(frm, grid_row, cdt, cdn){
var grid_row = cur_frm.open_grid_row();
if(frm.doc.workflow_state === “Approved”){
grid_row.grid_form.fields_dict.kra.df.read_only = true;
grid_row.grid_form.fields_dict.kra.refresh();
}
});