From b954bdfdf92c43c2f71bb4ca2f0efd0e377a7b9f Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 19 Feb 2024 22:18:57 +0530 Subject: [PATCH] fix: float division by zero (cherry picked from commit e8ae4ed61d3a5bc6913825f0da15dd630331a5af) --- erpnext/stock/stock_ledger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 379320237e..215b853e6a 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -899,7 +899,7 @@ class update_entries_after(object): precision = doc.precision("total_qty") self.wh_data.qty_after_transaction += flt(doc.total_qty, precision) - if self.wh_data.qty_after_transaction: + if flt(self.wh_data.qty_after_transaction, precision): self.wh_data.valuation_rate = flt(self.wh_data.stock_value, precision) / flt( self.wh_data.qty_after_transaction, precision )