fix: Safe cast row.rate (in case of faulty exploded items, edge case but oh well)

This commit is contained in:
marination 2022-05-27 21:59:59 +05:30
parent 2de2491e17
commit 978ba5238f

View File

@ -699,7 +699,7 @@ class BOM(WebsiteGenerator):
for row in self.get("exploded_items"):
old_rate = flt(row.rate)
row.rate = rm_rate_map.get(row.item_code)
row.amount = flt(row.stock_qty) * row.rate
row.amount = flt(row.stock_qty) * flt(row.rate)
if old_rate != row.rate:
# Only db_update if changed