fix: Cannot read properties of undefined (backport #40081) (#40083)

fix: Cannot read properties of undefined

(cherry picked from commit 44ed52c5cfa6a2432769bbb6f3c352aa81025de2)

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot] 2024-02-24 17:04:36 +05:30 committed by GitHub
parent d755b9d38c
commit 53d943ec70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}
}
},