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) { is_perpetual_inventory_enabled: function(company) {
if(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);
}
} }
}, },

View File

@@ -702,10 +702,7 @@ class StockReconciliation(StockController):
if allow_negative_stock: if allow_negative_stock:
return True return True
if any( if any((d.batch_no and flt(d.qty) == flt(d.current_qty)) for d in self.items):
(d.batch_no and flt(d.qty) == flt(d.current_qty))
for d in self.items
):
allow_negative_stock = True allow_negative_stock = True
return allow_negative_stock return allow_negative_stock