[FIX] sale_mrp, purchase: BoM quantity

The method `_bom_explode` requires a quantity in the UoM of the BoM.

opw-669764
This commit is contained in:
Nicolas Martinelli
2016-02-25 09:57:37 +01:00
parent c169c59e69
commit 74eb4cfc30
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -482,7 +482,8 @@ class PurchaseOrderLine(models.Model):
if bom.type != 'phantom':
continue
bom_delivered[bom.id] = False
bom_exploded = self.env['mrp.bom']._bom_explode(bom, line.product_id, line.product_qty)[0]
product_uom_qty_bom = self.env['product.uom']._compute_qty_obj(line.product_uom, line.product_qty, bom.product_uom)
bom_exploded = self.env['mrp.bom']._bom_explode(bom, line.product_id, product_uom_qty_bom)[0]
for bom_line in bom_exploded:
qty = 0.0
for move in line.move_ids:
+2 -1
View File
@@ -42,7 +42,8 @@ class SaleOrderLine(models.Model):
if bom.type != 'phantom':
continue
bom_delivered[bom.id] = False
bom_exploded = self.env['mrp.bom']._bom_explode(bom, self.product_id, self.product_uom_qty)[0]
product_uom_qty_bom = self.env['product.uom']._compute_qty_obj(self.product_uom, self.product_uom_qty, bom.product_uom)
bom_exploded = self.env['mrp.bom']._bom_explode(bom, self.product_id, product_uom_qty_bom)[0]
for bom_line in bom_exploded:
qty = 0.0
for move in self.procurement_ids.mapped('move_ids'):