fix: Zero division error while fetching unconsumed materials (#27293)

`
This commit is contained in:
Marica 2021-09-01 18:49:12 +05:30 committed by GitHub
parent 72ece75b11
commit 9506c14d35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1200,10 +1200,10 @@ class StockEntry(StockController):
wo_item_qty = item.transferred_qty or item.required_qty wo_item_qty = item.transferred_qty or item.required_qty
req_qty_each = ( wo_qty_consumed = flt(wo_item_qty) - flt(item.consumed_qty)
(flt(wo_item_qty) - flt(item.consumed_qty)) / wo_qty_to_produce = flt(work_order_qty) - flt(wo.produced_qty)
(flt(work_order_qty) - flt(wo.produced_qty))
) req_qty_each = (wo_qty_consumed) / (wo_qty_to_produce or 1)
qty = req_qty_each * flt(self.fg_completed_qty) qty = req_qty_each * flt(self.fg_completed_qty)