[FIX] sale_mrp, purchase: delivered quantity

The quantity delivered must be converted in the product UoM of the BoM
line. Indeed, the UoM of the BoM line can be different from the UoM of the
product which is manufactured.

opw-669764
This commit is contained in:
Nicolas Martinelli
2016-02-25 09:57:45 +01:00
parent 74eb4cfc30
commit 07ab3543be
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -488,7 +488,7 @@ class PurchaseOrderLine(models.Model):
qty = 0.0
for move in line.move_ids:
if move.state == 'done' and move.product_id.id == bom_line.get('product_id', False):
qty += self.env['product.uom']._compute_qty_obj(move.product_uom, move.product_uom_qty, self.product_uom)
qty += self.env['product.uom']._compute_qty(move.product_uom.id, move.product_uom_qty, bom_line['product_uom'])
if float_compare(qty, bom_line['product_qty'], precision_digits=precision) < 0:
bom_delivered[bom.id] = False
break
+1 -1
View File
@@ -48,7 +48,7 @@ class SaleOrderLine(models.Model):
qty = 0.0
for move in self.procurement_ids.mapped('move_ids'):
if move.state == 'done' and move.product_id.id == bom_line.get('product_id', False):
qty += self.env['product.uom']._compute_qty_obj(move.product_uom, move.product_uom_qty, self.product_uom)
qty += self.env['product.uom']._compute_qty(move.product_uom.id, move.product_uom_qty, bom_line['product_uom'])
if float_compare(qty, bom_line['product_qty'], precision_digits=precision) < 0:
bom_delivered[bom.id] = False
break