From ffdde952fbf95157e04fec755bfdd89e424cd2f4 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 12 Dec 2023 08:39:19 +0100 Subject: [PATCH] IDEMPIERE-5567 Support of UUID as Key (FHCA-4195) - Fixes #TestDay2023 (#2134) - CleanOrphanCascade is failing when there are orphan change log records for M_InOutLineMA or other non-ID tables - MoveClient is failing when there are AD_PInstance orphan records (because of the recently added AD_Table_ID reference) --- .../src/org/idempiere/process/CleanOrphanCascade.java | 2 +- .../src/org/idempiere/process/MoveClient.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base.process/src/org/idempiere/process/CleanOrphanCascade.java b/org.adempiere.base.process/src/org/idempiere/process/CleanOrphanCascade.java index 978d171746..88b768e818 100644 --- a/org.adempiere.base.process/src/org/idempiere/process/CleanOrphanCascade.java +++ b/org.adempiere.base.process/src/org/idempiere/process/CleanOrphanCascade.java @@ -139,7 +139,7 @@ public class CleanOrphanCascade extends SvrProcess String colRef = refTable.getKeyColumns()[0]; String colRefUU = PO.getUUIDColumnName(refTableName); - if (colRecordID != null && ! refTable.isUUIDKeyTable()) { + if (colRecordID != null && refTable.isIDKeyTable()) { StringBuilder whereClause = new StringBuilder("AD_Table_ID=").append(refTableID) .append(" AND Record_ID>0") .append(" AND NOT EXISTS (SELECT ").append(colRef) diff --git a/org.adempiere.base/src/org/idempiere/process/MoveClient.java b/org.adempiere.base/src/org/idempiere/process/MoveClient.java index 62c8b94a60..bbb65ef79a 100644 --- a/org.adempiere.base/src/org/idempiere/process/MoveClient.java +++ b/org.adempiere.base/src/org/idempiere/process/MoveClient.java @@ -1170,8 +1170,10 @@ public class MoveClient extends SvrProcess { return true; } } - if ("AD_ChangeLog".equalsIgnoreCase(tableName) || "AD_PInstance_Log".equalsIgnoreCase(tableName)) { - // skip orphan records in AD_ChangeLog and AD_PInstance_Log, can be log of deleted records, skip + if ( "AD_ChangeLog".equalsIgnoreCase(tableName) + || "AD_PInstance".equalsIgnoreCase(tableName) + || "AD_PInstance_Log".equalsIgnoreCase(tableName)) { + // skip orphan records in AD_ChangeLog, AD_PInstance and AD_PInstance_Log, can be log of deleted records, skip return true; } return false;