Merge pull request #48044 from frappe/mergify/bp/version-15-hotfix/pr-48037

fix: float division by zero (backport #48037)
This commit is contained in:
rohitwaghchaure
2025-06-15 18:29:02 +05:30
committed by GitHub

View File

@@ -883,7 +883,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)