From 45825263a4c1f43b6cde1443f45235ecc4eb7696 Mon Sep 17 00:00:00 2001 From: JF Aubert Date: Tue, 14 Nov 2023 08:51:31 +0100 Subject: [PATCH] [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) --- addons/mrp/report/mrp_report_mo_overview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/report/mrp_report_mo_overview.py b/addons/mrp/report/mrp_report_mo_overview.py index ec6930d904f..154a67a23bb 100644 --- a/addons/mrp/report/mrp_report_mo_overview.py +++ b/addons/mrp/report/mrp_report_mo_overview.py @@ -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,