Skip to content
Snippets Groups Projects
Commit 5e07b367 authored by JordiMForgeFlow's avatar JordiMForgeFlow
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#100771

Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent e99cdd64
No related branches found
No related tags found
No related merge requests found
......@@ -213,7 +213,7 @@ class MrpBom(models.Model):
if not products:
return bom_by_product
product_templates = products.mapped('product_tmpl_id')
domain = ['|', ('product_id', 'in', products.ids), '&', ('product_id', '=', False), ('product_tmpl_id', 'in', product_templates.ids)]
domain = ['|', ('product_id', 'in', products.ids), '&', ('product_id', '=', False), ('product_tmpl_id', 'in', product_templates.ids), ('active', '=', True)]
if picking_type:
domain += ['|', ('picking_type_id', '=', picking_type.id), ('picking_type_id', '=', False)]
if company_id or self.env.context.get('company_id'):
......
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