From 7df50314b5acbcdc7560f490d0c18aca9d99bdc2 Mon Sep 17 00:00:00 2001 From: "Tiffany Chang (tic)" Date: Fri, 27 Oct 2023 12:57:46 +0200 Subject: [PATCH] [FIX] mrp: use correct qty variable/term A "quantity_done" removal was missed in the MO Overview report, which made it so the report would throw an error when opened for a done MO. Also replace "Reserved" with "Quantity" in the overview so that it is more consistent with pickings + is more intuitive since it is currently confusing that when the qty produced is updated, then it appears that the qty reserved changes (rather than a qty being done) closes odoo/odoo#140246 Signed-off-by: William Henrotin (whe) --- addons/mrp/report/mrp_report_mo_overview.py | 2 +- addons/mrp/report/mrp_report_mo_overview.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mrp/report/mrp_report_mo_overview.py b/addons/mrp/report/mrp_report_mo_overview.py index 36495820ebd..1c7a8c37ea9 100644 --- a/addons/mrp/report/mrp_report_mo_overview.py +++ b/addons/mrp/report/mrp_report_mo_overview.py @@ -403,7 +403,7 @@ 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 production.state == 'done' and float_is_zero(move_raw.quantity, 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}" diff --git a/addons/mrp/report/mrp_report_mo_overview.xml b/addons/mrp/report/mrp_report_mo_overview.xml index 92155369a74..c6c1fa245b1 100644 --- a/addons/mrp/report/mrp_report_mo_overview.xml +++ b/addons/mrp/report/mrp_report_mo_overview.xml @@ -23,7 +23,7 @@ Status Quantity Free to use / On Hand - Reserved + Quantity Receipt Unit Cost MO Cost