[FIX] mrp: multi-company bom find
- Create 2 companies A & B - Create a product P with 2 phantom BOMs: Component C1 for company A, with sequence = 10 Component C2 for company B, with sequence = 0 - Create a SO in company A for P, validate The picking contains C2, while one would expect C1 since C2 is only for company B. opw-807640
This commit is contained in:
committed by
Nicolas Martinelli
parent
110613b2cc
commit
93c4c5cfb1
@@ -359,7 +359,7 @@ class StockMove(models.Model):
|
||||
# all grouped in the same picking.
|
||||
if not self.picking_type_id:
|
||||
return self
|
||||
bom = self.env['mrp.bom'].sudo()._bom_find(product=self.product_id)
|
||||
bom = self.env['mrp.bom'].sudo()._bom_find(product=self.product_id, company_id=self.company_id.id)
|
||||
if not bom or bom.type != 'phantom':
|
||||
return self
|
||||
phantom_moves = self.env['stock.move']
|
||||
|
||||
Reference in New Issue
Block a user