Hi Libero Folks,
On my recent studies about manufacturing order and workflow I've learned that in order to Adempiere create automatically a Manufacturing Order from a Sale Order, the Manufacturing Workflow's Search Key (value) must be the same as the Product's Search Key. That approach has a problem: my factory has about 2000 different products, so I'll have to create 2000 different workflows.
So, the first thing is a question: the conclusion above is right? I misunderstood something or should I be doing something different in order to create automatically a MO from a SO?
If the answer is: "yes, thats the way things were implemented", then comes the second thing: wouldnt be better if the same Manufacturing Workflow could be the workflow of various products in some way that a MO from a SO still works?
Finally, if the second answer is: yes, I would like to help. If this is not a thing on Libero's roadmap I would gladly put that on my personal roadmap to study deeper the functionalities and submit to you some changes to make that work this way. What do you think?
On Product Data Planning you can associate a workflow and a BOM to a particular product.
Hope it helps.
Victor Perez Juarez
>On my recent studies about manufacturing order and workflow I've learned that in order to Adempiere create automatically a >Manufacturing Order from a Sale Order, the Manufacturing Workflow's Search Key (value) must be the same as the Product's >Search Key. That approach has a problem: my factory has about 2000 different products, so I'll have to create 2000 different >workflows.
In general when you define Make to Order or Make to Engineering , Is necessary to create an specific engineering to the product, The BOM and Manufacturing Workflow are created based on the Customer's product features, anyway if you want to use the same Manufacturing Workflow for different products, then you can set the manufacturing workflow at Manufacturing Management -> Planning Management -> Product Planning Data Window.
Note: The search to get a Planning Data is based on Organization and Product
Victor and Teo, thanks for the answers.
The product's BOM and Workflow it's OK, I did it.
For the product planning data, its OK too, I can use one single Manufacturing Workflow for all my products but when I do that, Adempiere do not create automatically a MO when I complete a SO. Is Adempiere supposed to create a MO from a SO even if I use the same workflow for various products?
If you need create a MO from SO you need check:
The BOM Type for this product should be Make To Order or Make To Kit
The BOM Use for this product should be Manufacturing
The Manufacturing Order is created when the SO is complete.
Validate that LiberoValidator is activated.
That's the point, I did everything as you said and when complete the SO, Adempiere shows the error message:
ModelValidationEngine.fireModelChange: ERROR: null value on column "ad_workflow_id" violates a not-null restriction
The only way I've found to solve that was creating a Manufacturing Workflow with the same Search Key as the Product and that's what makes me think that I must have one workflow per product.
Did you create a product planning data record using only the organization and product setting the manufacturing workflow and nothing else ?
When you say "using only the organization", does that means not using organization=* ? If is that so, the answer is yes, I'm using one organization.
Beyond that I am configuring the BOM (Make to Order) and the Manufacture Workflow.
Check my before Note :-)
Note: The search to get a Planning Data is based on Organization and Product.
So you need create a Product Planning Data record with same organization that you use in SO organization, because you would have a manufacturing workflow and bom different for each organization, so if you set * in organization this will not found .
All the SO created has the same organization as the workflows and the BOMs. I didnt use * anywhere.
If you figure out something else I can do or check, please tell me.
I'll try to do the same thing on a clean version without Location BR modules and customization to double check that.
Thanks for the help.
Can please post here image the Product Planing Data with Tab Data Planning
You need to create a new record without resource and warehouse, the make to order only use the organization and product for search the planning data.
I did a little change to MPPProductPlanning.find so it will work even if you have a planning with resource and warehouse specified, maybe it can be useful:
public static MPPProductPlanning find (Properties ctx, int AD_Org_ID,
int M_Warehouse_ID, int S_Resource_ID, int M_Product_ID,
final String whereClause = "AD_Client_ID=? AND M_Product_ID=?"
+ " AND (AD_Org_ID IN (0,?) OR AD_Org_ID IS NULL)"
+ " AND (M_Warehouse_ID IN (0,?) OR M_Warehouse_ID IS NULL OR 0=?)" // Angelo Dabalà (genied) added test for passing 0 as S_Resource_ID or M_Warehouse_ID
+ " AND (S_Resource_ID IN (0,?) OR S_Resource_ID IS NULL OR 0=?)";
return new Query(ctx, Table_Name, whereClause, trxName)
.setParameters(Env.getAD_Client_ID(ctx), M_Product_ID, AD_Org_ID, M_Warehouse_ID, M_Warehouse_ID, S_Resource_ID, S_Resource_ID)
.setOrderBy("COALESCE(AD_Org_ID, 0) DESC"
+", COALESCE(M_Warehouse_ID, 0) DESC"
+", COALESCE(S_Resource_ID, 0) DESC")
OK, I'll try that. Thanks!
Victor Perez Juarez
I was reviewing this business case and have an idea to implement the best solution.
So to avoid creating a product planning data record without resource and warehouse , we can use the warehouse from sales order and the plant type manufacturing resource that have the same warehouse defined.
Is necessary create a new unique index for S_Resource_ID , M_Warehouse_ID, Manufacturing REsource Type to avoid duplicated records
Won't that cause any trouble on Manufacturing Order Window (inside Discreet Manufacturing)?
At this window (filling data manually), when I fill the Product field, Adempiere tries to automatically fills Workflow and BOM, and in that case you will have no SO linked to the MO. At the moment, if Adempiere find no product's workflow the field workflow gains a value like: <0> and user need to manually select a workflow. I dont know if this Adempiere behavior is the expected.
Feeding back: I removed resource and warehouse from the product planning and Adempiere still shows the same error.
Victor Perez Juarez
The bugfix was solve:
I changed the approach to search Product Planning Data. Now the warehouse is based on Sales Order and ADempiere try search a Manufacturing Resource Plant with same warehouse.
Great News. How do I download a release with that change?
Victor Perez Juarez
You can download the binary files http://sourceforge.net/projects/adempiere/files/Adempiere%20Packages/Libero%20Manufacturing/
any progress about this topic?
SO to MO does not work when I installed new manufacturing packages, no error message posted.
my settings for the product (all in the same orgnization):
1.The BOM Type: Make To Order
2. The BOM Use : Manufacturing
3. the product data planning: bom and workflow with the same name as the product
4. Validate: org.eevolution.model.LiberoValidator (I even did not set this while it worked in the last libero version)