mirror of
https://github.com/bringout/oca-ocb-mrp.git
synced 2026-04-26 17:12:05 +02:00
19.0 vanilla
This commit is contained in:
parent
accf5918df
commit
6e65e8c877
688 changed files with 225434 additions and 199401 deletions
|
|
@ -1,9 +1,9 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.osv.expression import AND
|
||||
from odoo.fields import Domain
|
||||
|
||||
|
||||
class MrpBom(models.Model):
|
||||
_inherit = 'mrp.bom'
|
||||
|
|
@ -16,7 +16,7 @@ class MrpBom(models.Model):
|
|||
def _bom_subcontract_find(self, product, picking_type=None, company_id=False, bom_type='subcontract', subcontractor=False):
|
||||
domain = self._bom_find_domain(product, picking_type=picking_type, company_id=company_id, bom_type=bom_type)
|
||||
if subcontractor:
|
||||
domain = AND([domain, [('subcontractor_ids', 'parent_of', subcontractor.ids)]])
|
||||
domain &= Domain('subcontractor_ids', 'parent_of', subcontractor.ids)
|
||||
return self.search(domain, order='sequence, product_id, id', limit=1)
|
||||
else:
|
||||
return self.env['mrp.bom']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue