Skip to content

Commit

Permalink
FIX: problem on create normal bom
Browse files Browse the repository at this point in the history
If a bom is a kit bom dose not allow to create normal bom
  • Loading branch information
mboscolo committed Sep 16, 2024
1 parent 1ba8d19 commit 2d4e661
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plm_engineering/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ def action_create_normalBom(self):
('type', '=', 'normal')])
if obj_boms:
raise UserError(_("Normal BoM for Part '%s' and revision '%s' already exists." % (obj_boms.product_tmpl_id.engineering_code, obj_boms.product_tmpl_id.engineering_revision)))

if obj_brws.env['mrp.bom'].search_count([('product_tmpl_id', '=', id_template),
('type', '=', 'phantom')]):
raise UserError(_("""Normal BoM for Part '%s' and revision '%s' have a kit bom present.\n"""
"""If you whant to create the normal bom please delete the kit bom first !
""" % (product_browse.engineering_code, obj_boms.product_tmpl_id.engineering_revision)))
line_messages_list = product_product_type_object.create_bom_from_ebom(
product_browse, 'normal',
obj_brws.summarize,
Expand Down

0 comments on commit 2d4e661

Please sign in to comment.