summaryrefslogtreecommitdiff
path: root/addons/purchase_mrp/models
diff options
context:
space:
mode:
authorArnaud Baes <arb@odoo.com>2018-12-04 12:38:40 +0000
committerArnaud Baes <arb@odoo.com>2018-12-19 10:50:29 +0000
commitefb255246b1a60b8299ce1c39ef404d3618b368a (patch)
tree695fe0ad556a607f9674f51c2e5f0e985ad3e4d2 /addons/purchase_mrp/models
parent45e53ff7a599f87bf98fc67934ebf083c2dcaee1 (diff)
[REF] mrp, purchase_mrp: find bom depending on its type
This commit refactors the method '_bom_find' in order to search bom based on their type. This allows to handle the cases where a Kit has the route 'Manufacture' set. TaskID: 1863856
Diffstat (limited to 'addons/purchase_mrp/models')
-rw-r--r--addons/purchase_mrp/models/purchase_mrp.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/purchase_mrp/models/purchase_mrp.py b/addons/purchase_mrp/models/purchase_mrp.py
index 20d10244015..7c0e78381a8 100644
--- a/addons/purchase_mrp/models/purchase_mrp.py
+++ b/addons/purchase_mrp/models/purchase_mrp.py
@@ -19,8 +19,8 @@ class PurchaseOrderLine(models.Model):
super(PurchaseOrderLine, self)._compute_qty_received()
for line in self:
if line.qty_received_method == 'stock_moves' and line.move_ids and line.product_id.id not in line.move_ids.mapped('product_id').ids:
- bom = self.env['mrp.bom']._bom_find(product=line.product_id, company_id=line.company_id.id)
- if bom and bom.type == 'phantom':
+ bom = self.env['mrp.bom']._bom_find(product=line.product_id, company_id=line.company_id.id, bom_type='phantom')
+ if bom:
line.qty_received = line._get_bom_delivered(bom=bom)
def _get_bom_delivered(self, bom=False):