From ef4d6ca91144feded7105fc251c4e287f8966bc5 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 --- 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 bedd094813b..2e7c125e88f 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -50,7 +50,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); + } } }, -- GitLab