IDEMPIERE-6174 - Create Production from Order process doesn't set BOM Formula (#2399)

This commit is contained in:
Peter Takács 2024-06-19 05:08:14 +02:00 committed by Carlos Ruiz
parent 77f0ababe6
commit 061ef5fec4
2 changed files with 6 additions and 0 deletions

View File

@ -37,6 +37,7 @@ import org.compiere.model.MWarehouse;
import org.compiere.model.Query; import org.compiere.model.Query;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.eevolution.model.MPPProductBOM;
/** /**
* *
@ -90,11 +91,13 @@ public class OrderCreateProduction extends SvrProcess {
MProduction production = new MProduction(line); MProduction production = new MProduction(line);
MProduct product = new MProduct(getCtx(), line.getM_Product_ID(), get_TrxName()); MProduct product = new MProduct(getCtx(), line.getM_Product_ID(), get_TrxName());
MPPProductBOM productBOM = MPPProductBOM.getDefault(product, get_TrxName());
production.setM_Product_ID(line.getM_Product_ID()); production.setM_Product_ID(line.getM_Product_ID());
production.setProductionQty(line.getQtyOrdered().subtract(line.getQtyDelivered())); production.setProductionQty(line.getQtyOrdered().subtract(line.getQtyDelivered()));
production.setDatePromised(line.getDatePromised()); production.setDatePromised(line.getDatePromised());
production.setC_OrderLine_ID(line.getC_OrderLine_ID()); production.setC_OrderLine_ID(line.getC_OrderLine_ID());
production.setPP_Product_BOM_ID(productBOM.getPP_Product_BOM_ID());
int locator = product.getM_Locator_ID(); int locator = product.getM_Locator_ID();
if (locator == 0) if (locator == 0)

View File

@ -27,6 +27,7 @@ import org.compiere.model.MWarehouse;
import org.compiere.util.DB; import org.compiere.util.DB;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.eevolution.model.MPPProductBOM;
/** /**
* Create (Generate) Production from OrderLine * Create (Generate) Production from OrderLine
@ -86,11 +87,13 @@ public class OrderLineCreateProduction extends SvrProcess
MProduction production = new MProduction( line ); MProduction production = new MProduction( line );
MProduct product = new MProduct (getCtx(), line.getM_Product_ID(), get_TrxName()); MProduct product = new MProduct (getCtx(), line.getM_Product_ID(), get_TrxName());
MPPProductBOM productBOM = MPPProductBOM.getDefault(product, get_TrxName());
production.setM_Product_ID(line.getM_Product_ID()); production.setM_Product_ID(line.getM_Product_ID());
production.setProductionQty(line.getQtyOrdered().subtract(line.getQtyDelivered())); production.setProductionQty(line.getQtyOrdered().subtract(line.getQtyDelivered()));
production.setDatePromised(line.getDatePromised()); production.setDatePromised(line.getDatePromised());
production.setC_OrderLine_ID(p_C_OrderLine_ID); production.setC_OrderLine_ID(p_C_OrderLine_ID);
production.setPP_Product_BOM_ID(productBOM.getPP_Product_BOM_ID());
int locator = product.getM_Locator_ID(); int locator = product.getM_Locator_ID();
if ( locator == 0 ) if ( locator == 0 )