Merge pull request #39967 from rohitwaghchaure/fixed-subcontracting-pr-10107

fix: float division by zero
This commit is contained in:
rohitwaghchaure 2024-02-20 06:30:57 +05:30 committed by GitHub
commit fa1113f912
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
)