diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index 4c76e2a869e..27c7444daf4 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -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); + } } }, diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 44c2d85b4cc..878af0e22ca 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -702,10 +702,7 @@ class StockReconciliation(StockController): if allow_negative_stock: return True - if any( - (d.batch_no and flt(d.qty) == flt(d.current_qty)) - for d in self.items - ): + if any((d.batch_no and flt(d.qty) == flt(d.current_qty)) for d in self.items): allow_negative_stock = True return allow_negative_stock