fix: Cannot read properties of undefined (reading 'work_order_closed') (backport #44117) (#44122)

fix: Cannot read properties of undefined (reading 'work_order_closed') (#44117)

(cherry picked from commit 13834014b5)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-11-13 16:24:12 +05:30
committed by GitHub
parent b65b57c054
commit c1983a4846

View File

@@ -37,7 +37,7 @@ frappe.ui.form.on("Job Card", {
frappe.flags.resume_job = 0;
let has_items = frm.doc.items && frm.doc.items.length;
if (!frm.is_new() && frm.doc.__onload.work_order_closed) {
if (!frm.is_new() && frm.doc.__onload?.work_order_closed) {
frm.disable_save();
return;
}