fix: Cannot read properties of undefined

This commit is contained in:
Rohit Waghchaure 2024-02-24 15:33:59 +05:30
parent dd23ddcd6c
commit 44ed52c5cf

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