From 3d65230d9d3acd10cf54946da76d6ff77f2075c8 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Sat, 24 Feb 2024 15:33:59 +0530 Subject: [PATCH] fix: Cannot read properties of undefined (cherry picked from commit 44ed52c5cfa6a2432769bbb6f3c352aa81025de2) --- erpnext/public/js/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index de46271e4740..456a215f10b7 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -40,7 +40,10 @@ $.extend(erpnext, { is_perpetual_inventory_enabled: function(company) { if(company) { - return frappe.get_doc(":Company", company).enable_perpetual_inventory + let company_local = locals[":Company"] && locals[":Company"][company]; + if(company_local) { + return cint(company_local.enable_perpetual_inventory); + } } },