[FIX] mrp: fix the filter order in _bom_find_domain

Only active boms should be returned by the domain even if
they match a product id.

closes odoo/odoo#106615

X-original-commit: 2a73890d304476833d76bac9a36ef92f12f267a3
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This commit is contained in:
Jinane Maksoud
2022-11-28 14:51:36 +01:00
parent cd704e7119
commit 4e06b34bce
+1 -1
View File
@@ -224,7 +224,7 @@ class MrpBom(models.Model):
@api.model
def _bom_find_domain(self, products, picking_type=None, company_id=False, bom_type=False):
domain = ['|', ('product_id', 'in', products.ids), '&', '&', ('product_id', '=', False), ('product_tmpl_id', 'in', products.product_tmpl_id.ids), ('active', '=', True)]
domain = ['&', '|', ('product_id', 'in', products.ids), '&', ('product_id', '=', False), ('product_tmpl_id', 'in', products.product_tmpl_id.ids), ('active', '=', True)]
if company_id or self.env.context.get('company_id'):
domain = AND([domain, ['|', ('company_id', '=', False), ('company_id', '=', company_id or self.env.context.get('company_id'))]])
if picking_type: