[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
This commit is contained in:
clesgow
2023-10-20 14:59:09 +00:00
parent d119453591
commit abe7725baa
@@ -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