fix: float division by zero

This commit is contained in:
Rohit Waghchaure
2025-06-12 17:20:22 +05:30
parent 46985e0f3c
commit 59cbe85817

View File

@@ -887,7 +887,10 @@ class update_entries_after:
self.wh_data.valuation_rate
)
if sle.actual_qty < 0 and self.wh_data.qty_after_transaction != 0:
if (
sle.actual_qty < 0
and flt(self.wh_data.qty_after_transaction, self.flt_precision) != 0
):
self.wh_data.valuation_rate = flt(
self.wh_data.stock_value, self.currency_precision
) / flt(self.wh_data.qty_after_transaction, self.flt_precision)