From SO to MO - Manufacturing Workflows

2012-04-18
2013-10-13
  • Marcio Rebello
    Marcio Rebello
    2012-04-18

    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?

     
  • Teo Sarca
    Teo Sarca
    2012-04-18

    Hi,

    On Product Data Planning you can associate a workflow and a BOM to a particular product.

    Hope it helps.

    Best regards,
    Teo Sarca

     
  • Hi Aeon!

    >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

    kind regards
    Victor Perez
    www.e-evolution.com

     
  • Marcio Rebello
    Marcio Rebello
    2012-04-18

    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?

    best regards,

    Marcio

     
  • Hi Mario!

    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.

    kind regards
    Victor Perez
    www.e-evolution.com

     
  • Marcio Rebello
    Marcio Rebello
    2012-04-18

    Hi Victor,

    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.

    Any ideas?

    best regards,

    Marcio

     
  • Hi Marcio!

    Did you create a product planning data record using only the organization and product setting the manufacturing workflow and nothing else ?

    kind regards
    Victor

     
  • Marcio Rebello
    Marcio Rebello
    2012-04-18

    Hi Victor,

    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.

    best regards,

    Marcio

     
  • Hi Marcio!

    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 .

    kind regards
    Victor

     
  • Marcio Rebello
    Marcio Rebello
    2012-04-18

    Hi Victor,

    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.

    best regards,

    Marcio

     
  • Marcio!

    Can please post here image the Product Planing Data with Tab  Data Planning

    kind regards
    Victor

     
  • Marcio Rebello
    Marcio Rebello
    2012-04-18

     
  • Hi Marcio!

    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.

    kind regards
    Victor

     
  • Angelo Dabalà
    Angelo Dabalà
    2012-04-19

    Hi Victor,

    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,
    String trxName)
    {         
    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)
    .setOnlyActiveRecords(true)
    .setOrderBy("COALESCE(AD_Org_ID, 0) DESC"
    +", COALESCE(M_Warehouse_ID, 0) DESC"
    +", COALESCE(S_Resource_ID, 0) DESC")
    .first();
    }

    Regards,
    Angelo

     
  • Marcio Rebello
    Marcio Rebello
    2012-04-19

    Hi Victor,

         OK, I'll try that. Thanks!

    best regards,

    Marcio

     
  • Hi guys!

    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

    WDYT?

    Victor Perez
    www.e-evolution.com

     
  • Marcio Rebello
    Marcio Rebello
    2012-04-19

    Hi Victor,

    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.

    best regards,

    Marcio

     
  • Marcio Rebello
    Marcio Rebello
    2012-04-19

    HI Victor,

    Feeding back: I removed resource and warehouse from the product planning and Adempiere still shows the same error.

    best regards,

    Marcio

     
  • Hi Marcio!

    The bugfix was solve:

    https://adempiere.atlassian.net/browse/MFG-10

    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.

    kind regards
    Victor Perez
    www.e-evolution.com

     
  • Marcio Rebello
    Marcio Rebello
    2012-04-24

    Hi Victor,

    Great News. How do I download a release with that change?

    best regards,

    Marcio

     
  • bma99
    bma99
    2012-09-05

    Hi all,
    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)

    Thanks,
    bma