diff --git a/org.adempiere.base/src/org/compiere/model/MAssetGroup.java b/org.adempiere.base/src/org/compiere/model/MAssetGroup.java index de3d9bd917..a7429ca6c3 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetGroup.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetGroup.java @@ -58,6 +58,8 @@ public class MAssetGroup extends X_A_Asset_Group ag = new MAssetGroup(ctx, A_Asset_Group_ID, null); if (ag != null && ag.get_ID() != A_Asset_Group_ID) ag = null; + else + s_cache.put(A_Asset_Group_ID, ag); // return ag; } diff --git a/org.adempiere.base/src/org/compiere/model/MProductCategory.java b/org.adempiere.base/src/org/compiere/model/MProductCategory.java index 1c836a32d9..4c1603765e 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductCategory.java +++ b/org.adempiere.base/src/org/compiere/model/MProductCategory.java @@ -52,10 +52,13 @@ public class MProductCategory extends X_M_Product_Category public static MProductCategory get (Properties ctx, int M_Product_Category_ID) { Integer ii = new Integer (M_Product_Category_ID); - MProductCategory pc = (MProductCategory)s_cache.get(ii); - if (pc == null) - pc = new MProductCategory (ctx, M_Product_Category_ID, null); - return pc; + MProductCategory retValue = (MProductCategory)s_cache.get(ii); + if (retValue != null) + return retValue; + retValue = new MProductCategory (ctx, M_Product_Category_ID, null); + if (retValue.get_ID () != 0) + s_cache.put (M_Product_Category_ID, retValue); + return retValue; } // get /**