From d13a0e1a5c4513ed67ed07ef30bd5e979c2f95bb Mon Sep 17 00:00:00 2001 From: amoyaux Date: Fri, 29 Sep 2017 11:17:19 +0200 Subject: [PATCH] [FIX] stock: wrong uom on tracability report. The tracability report was using the quantity done (with the unit of measure from he move line) and the uom of the product (quant uom) This commit changes the quantity done in order to keep the same uom in the report. (uom of quants) --- addons/stock/models/stock_traceability.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/models/stock_traceability.py b/addons/stock/models/stock_traceability.py index 96996c49fba..dfd920088a8 100644 --- a/addons/stock/models/stock_traceability.py +++ b/addons/stock/models/stock_traceability.py @@ -155,7 +155,7 @@ class MrpStockReport(models.TransientModel): 'model_id': move_line.id, 'model':'stock.move.line', 'product_id': move_line.product_id.display_name, - 'product_qty_uom': str(move_line.qty_done) + ' ' + move_line.product_id.uom_id.name, + 'product_qty_uom': str(move_line.product_uom_id._compute_quantity(move_line.qty_done, move_line.product_id.uom_id, rounding_method='HALF-UP')) + ' ' + move_line.product_id.uom_id.name, 'location': move_line.location_id.name + ' -> ' + move_line.location_dest_id.name, 'reference_id': ref, 'res_id': res_id, @@ -175,7 +175,7 @@ class MrpStockReport(models.TransientModel): 'model': model or 'stock.move.line', 'product_id': move_line.product_id.display_name, 'lot_id': move_line.lot_id.name, - 'product_qty_uom': str(move_line.qty_done) + ' ' + move_line.product_id.uom_id.name, + 'product_qty_uom': str(move_line.product_uom_id._compute_quantity(move_line.qty_done, move_line.product_id.uom_id, rounding_method='HALF-UP')) + ' ' + move_line.product_id.uom_id.name, 'location': move_line.location_dest_id.name, 'stream': stream, 'reference_id': False}]