diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index c52470bf3d5..709ce9b437f 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -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: diff --git a/addons/sale_mrp/sale_mrp.py b/addons/sale_mrp/sale_mrp.py index 41064bafdf9..48b22f53210 100644 --- a/addons/sale_mrp/sale_mrp.py +++ b/addons/sale_mrp/sale_mrp.py @@ -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'):