From e3cab6c238acbf997987e3d14a7680251ea1d29e Mon Sep 17 00:00:00 2001 From: matheus-marcelinux Date: Fri, 3 Nov 2023 16:40:56 -0300 Subject: [PATCH] IDEMPIERE-5874 - adding AD_Client_ID to MDistribution cache key (#2040) * IDEMPIERE-5874 - adding AD_Client_ID to MDistribution cache key * IDEMPIERE-5874 - applying deprecation patch --- .../src/org/compiere/model/MDistribution.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MDistribution.java b/org.adempiere.base/src/org/compiere/model/MDistribution.java index 2639328c35..d6c706633e 100644 --- a/org.adempiere.base/src/org/compiere/model/MDistribution.java +++ b/org.adempiere.base/src/org/compiere/model/MDistribution.java @@ -201,11 +201,13 @@ public class MDistribution extends X_GL_Distribution * Get Distributions for Account * @param Account_ID id * @return array of distributions + * @deprecated - using the method to get a specific account ID doesn't make sense because of the flag IsAnyAcct + * use method getAll() instead */ public static MDistribution[] get (int Account_ID) { Properties ctx = Env.getCtx(); - Integer key = Integer.valueOf(Account_ID); + String key = Env.getAD_Client_ID(ctx) + "_" + Account_ID; MDistribution[] retValue = (MDistribution[])s_accounts.get(key); if (retValue != null) return retValue; @@ -251,8 +253,8 @@ public class MDistribution extends X_GL_Distribution @SuppressWarnings("unused") private static CLogger s_log = CLogger.getCLogger (MDistribution.class); /** Distributions by Account */ - private static CCache s_accounts - = new CCache(Table_Name, 100); + private static CCache s_accounts + = new CCache(Table_Name, 100); /**