From abe7725baae093f08c4235bc245365055be980a1 Mon Sep 17 00:00:00 2001 From: clesgow Date: Wed, 12 Jul 2023 13:40:38 +0200 Subject: [PATCH] [FIX] mrp: hide components that weren't consumed in done MO Overview If a component wasn't consumed at all during the manufacturing process, we don't want to see it on the final Overview. Task-3251506 Part-of: odoo/odoo#114536 --- addons/mrp/report/mrp_report_mo_overview.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/mrp/report/mrp_report_mo_overview.py b/addons/mrp/report/mrp_report_mo_overview.py index 1a9c0d49c13..72291b0fc25 100644 --- a/addons/mrp/report/mrp_report_mo_overview.py +++ b/addons/mrp/report/mrp_report_mo_overview.py @@ -292,6 +292,9 @@ class ReportMoOverview(models.AbstractModel): else: replenish_data = self._get_replenishments_from_forecast(production, replenish_data) for count, move_raw in enumerate(production.move_raw_ids): + if production.state == 'done' and float_is_zero(move_raw.quantity_done, precision_rounding=move_raw.product_uom.rounding): + # If a product wasn't consumed in the MO by the time it is done, no need to display it on the final Overview. + continue component_index = f"{current_index}{count}" replenishments = self._get_replenishment_lines(production, move_raw, replenish_data, level, component_index) # If not enough replenishment -> To Order / Might get "non-available" in summary since all component won't be there in time