From ed20cebf58310a3deaed19bc8e67983bc738b024 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 13 Nov 2024 15:15:07 +0530 Subject: [PATCH] fix: Cannot read properties of undefined (reading 'work_order_closed') --- erpnext/manufacturing/doctype/job_card/job_card.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/job_card/job_card.js b/erpnext/manufacturing/doctype/job_card/job_card.js index 770872093cb8..a7aff14638d1 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.js +++ b/erpnext/manufacturing/doctype/job_card/job_card.js @@ -72,7 +72,7 @@ frappe.ui.form.on("Job Card", { let has_items = frm.doc.items && frm.doc.items.length; frm.trigger("make_fields_read_only"); - if (!frm.is_new() && frm.doc.__onload.work_order_closed) { + if (!frm.is_new() && frm.doc.__onload?.work_order_closed) { frm.disable_save(); return; }