Skip to Content

Welcome!

Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

Sign up

You need to be registered to interact with the community.
This question has been flagged
1 Reply
35 Views

Who can help me with the solution?

I'm trying to create the following proces:

When I create a new product with a specific product category, the automatic action should duplicate an existing Bill of Material and link that the the new product.

So, dependent on the product category, an specific BoM should be created by duplicating an existing BoM together with all the components.

Thanks you in advance for your help

Avatar
Discard

If you make an automated action on the product.template create, and execute python code. You can use  the following code:

if record.categ_id.id == 111:

    env['mrp.bom'].browse(113).copy({'product_tmpl_id': record.id})

You will just need to replace the 111 and 113 with the IDs that you want, and if you want different BoMs for different categories just copy and paste underneath.

Avatar
Discard

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!