[FIX] mrp: avoid mo overview traceback

Opening the Overview of manufacturing orders containing work orders
without expected duration gives a division by zero.

closes odoo/odoo#141944

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This commit is contained in:
JF Aubert
2023-11-15 11:26:03 +00:00
parent b7eaf02706
commit 45825263a4
+1 -1
View File
@@ -281,7 +281,7 @@ class ReportMoOverview(models.AbstractModel):
'quantity_decorator': self._get_comparison_decorator(workorder.duration_expected, wo_duration, 0.01),
'uom_name': operation_uom,
'production_id': production.id,
'unit_cost': expected_cost / workorder.duration_expected,
'unit_cost': expected_cost / (workorder.duration_expected or 1),
'mo_cost': mo_cost,
'real_cost': real_cost,
'currency_id': currency.id,