From 364036017b3f5d5ea095870eac7df10824648f4c Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 7 Feb 2017 15:59:52 +0100 Subject: [PATCH] [FIX] mrp: UoM of quantity available The field `quantity_available` can be computed in two different ways: - equal to `product_uom_qty` - equal to `reserved_availability` However, `product_uom_qty` is in the UoM of the move, while `reserved_availability` is in the UoM of the product. We convert into the UoM of the move, because `quantity_available` is supposed to be in the same UoM than `product_uom_qty` ("To Consume"). opw-704775 --- addons/mrp/models/stock_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/models/stock_move.py b/addons/mrp/models/stock_move.py index 1d67c226bca..2e13a820882 100644 --- a/addons/mrp/models/stock_move.py +++ b/addons/mrp/models/stock_move.py @@ -88,7 +88,7 @@ class StockMove(models.Model): if move.state == 'assigned': move.quantity_available = move.product_uom_qty else: - move.quantity_available = move.reserved_availability + move.quantity_available = move.product_id.uom_id._compute_quantity(move.reserved_availability, move.product_uom) @api.multi @api.depends('move_lot_ids', 'move_lot_ids.quantity_done', 'quantity_done_store')