diff --git a/org.adempiere.base/src/org/compiere/model/MInOutLine.java b/org.adempiere.base/src/org/compiere/model/MInOutLine.java index 7c97b18f4e..d20e0b66bc 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutLine.java @@ -578,7 +578,7 @@ public class MInOutLine extends X_M_InOutLine } } - I_M_AttributeSet attributeset = getM_Product().getM_AttributeSet(); + I_M_AttributeSet attributeset = MProduct.get(getCtx(), getM_Product_ID()).getM_AttributeSet(); boolean isAutoGenerateLot = false; if (attributeset != null) isAutoGenerateLot = attributeset.isAutoGenerateLot(); diff --git a/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java b/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java index 73708233ee..a2445a894f 100644 --- a/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java +++ b/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java @@ -173,7 +173,7 @@ public class MStorageOnHand extends X_M_StorageOnHand String sqlWhere = "M_Product_ID=? AND M_Locator_ID=? AND QtyOnHand <> 0"; Query query = new Query(ctx, MStorageOnHand.Table_Name, sqlWhere, trxName) .setParameters(M_Product_ID, M_Locator_ID); - MProduct product = new MProduct(ctx, M_Product_ID, trxName); + MProduct product = MProduct.get(ctx, M_Product_ID); if (product.isUseGuaranteeDateForMPolicy()) { query.addJoinClause(" LEFT OUTER JOIN M_AttributeSetInstance asi ON (M_StorageOnHand.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID) ") diff --git a/org.adempiere.base/src/org/compiere/model/MStorageReservation.java b/org.adempiere.base/src/org/compiere/model/MStorageReservation.java index c0b9603871..c8b2a4d075 100644 --- a/org.adempiere.base/src/org/compiere/model/MStorageReservation.java +++ b/org.adempiere.base/src/org/compiere/model/MStorageReservation.java @@ -228,7 +228,7 @@ public class MStorageReservation extends X_M_StorageReservation { return true; /* Do NOT use FIFO ASI for reservation */ - MProduct prd = new MProduct(ctx, M_Product_ID, trxName); + MProduct prd = MProduct.get(ctx, M_Product_ID); if (prd.getM_AttributeSet_ID() == 0 || ! prd.getM_AttributeSet().isInstanceAttribute()) { // Product doesn't manage attribute set, always reserved with 0 M_AttributeSetInstance_ID = 0; diff --git a/org.adempiere.base/src/org/compiere/model/ProductCost.java b/org.adempiere.base/src/org/compiere/model/ProductCost.java index fd63e86324..2062d733d5 100644 --- a/org.adempiere.base/src/org/compiere/model/ProductCost.java +++ b/org.adempiere.base/src/org/compiere/model/ProductCost.java @@ -48,7 +48,7 @@ public class ProductCost { m_M_Product_ID = M_Product_ID; if (m_M_Product_ID != 0) - m_product = new MProduct(ctx, M_Product_ID, trxName); + m_product = MProduct.get(ctx, M_Product_ID); m_M_AttributeSetInstance_ID = M_AttributeSetInstance_ID; m_trxName = trxName; } // ProductCost