[FIX] mrp_subcontracting: empty BoM if no subcontractor
_bom_subcontract_find return a BoM of typer subcontractor for any partners if the subcontractor is not set. The real behavior is to not create a subcontracting order if the partner is not set.
This commit is contained in:
committed by
Simon Lejeune
parent
93c53265ed
commit
167fd934a8
@@ -14,4 +14,7 @@ class MrpBom(models.Model):
|
||||
domain = self._bom_find_domain(product_tmpl=product_tmpl, product=product, picking_type=picking_type, company_id=company_id, bom_type=bom_type)
|
||||
if subcontractor:
|
||||
domain = AND([domain, [('subcontractor_ids', 'in', subcontractor.id)]])
|
||||
return self.search(domain, order='sequence, product_id', limit=1)
|
||||
return self.search(domain, order='sequence, product_id', limit=1)
|
||||
else:
|
||||
return self.env['mrp.bom']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user