Skip to content
Snippets Groups Projects
Commit a5f92385 authored by JordiMForgeFlow's avatar JordiMForgeFlow Committed by William Henrotin
Browse files

[FIX] mrp: ensure only active BoMs are considered on product2bom


When executing the product2bom method it is possible that an active_test
context is present in self. However, the method should not consider
archived BoMs.

closes odoo/odoo#104512

X-original-commit: 5e07b367
Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent a92e0ad6
No related branches found
No related tags found
No related merge requests found
......@@ -221,7 +221,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)]
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