Skip to content

Commit

Permalink
[FIX] mrp: fix the filter order in _bom_find_domain
Browse files Browse the repository at this point in the history
Only active boms should be returned by the domain even if
they match a product id.

closes odoo#106615

X-original-commit: 2a73890
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
  • Loading branch information
jjmaksoud committed Nov 28, 2022
1 parent cd704e7 commit 4e06b34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/mrp/models/mrp_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def _unlink_except_running_mo(self):

@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:
Expand Down

0 comments on commit 4e06b34

Please sign in to comment.