Skip to content
Snippets Groups Projects
Commit 2203f27a authored by Jinane Maksoud's avatar Jinane Maksoud
Browse files

[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#106608

X-original-commit: 2a73890d
Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent 63a18275
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment