From e9e2239d0c5744d405d03f1539b1e114c18dbe49 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 27 Nov 2023 09:01:43 +0100 Subject: [PATCH] IDEMPIERE-5940 Move/Copy Client failing when there are tables without AD_Client_ID (#2117) --- org.adempiere.base/src/org/idempiere/process/MoveClient.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/org.adempiere.base/src/org/idempiere/process/MoveClient.java b/org.adempiere.base/src/org/idempiere/process/MoveClient.java index 7aaae57159..62c8b94a60 100644 --- a/org.adempiere.base/src/org/idempiere/process/MoveClient.java +++ b/org.adempiere.base/src/org/idempiere/process/MoveClient.java @@ -454,6 +454,10 @@ public class MoveClient extends SvrProcess { sqlCountData.append(" JOIN AD_PInstance ON (AD_PInstance_Log.AD_PInstance_ID=AD_PInstance.AD_PInstance_ID)"); sqlCountData.append(" JOIN AD_Client ON (AD_PInstance.AD_Client_ID=AD_Client.AD_Client_ID)"); } else { + if (MColumn.get(getCtx(), tableName, "AD_Client_ID") == null) { + if (log.isLoggable(Level.WARNING)) log.warning("Ignoring " + tableName + ", doesn't have column AD_Client_ID"); + return; + } sqlCountData.append(" JOIN AD_Client ON (").append(tableName).append(".AD_Client_ID=AD_Client.AD_Client_ID)"); } sqlCountData.append(" WHERE ").append(p_whereClient);