fix: ZeroDivisionError: float division by zero in SCR

This commit is contained in:
s-aga-r 2023-01-08 11:49:40 +05:30
parent 9ab8aa49d6
commit 434aa594d5

View File

@ -157,7 +157,7 @@ class SubcontractingReceipt(SubcontractingController):
total_qty = total_amount = 0
for item in self.items:
if item.name in rm_supp_cost:
if item.qty and item.name in rm_supp_cost:
item.rm_supp_cost = rm_supp_cost[item.name]
item.rm_cost_per_qty = item.rm_supp_cost / item.qty
rm_supp_cost.pop(item.name)