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

* fix: Cannot read properties of undefined

(cherry picked from commit 44ed52c5cf)

* chore: fix linter issue

---------

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-02-24 17:22:37 +05:30
committed by GitHub
parent 2b01b102b4
commit 579b27d010
2 changed files with 5 additions and 5 deletions

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