[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
This commit is contained in:
Nicolas Martinelli
2017-02-07 16:33:46 +01:00
parent b2cf9559d6
commit 364036017b
+1 -1
View File
@@ -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')