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)
This commit is contained in:
Carlos Ruiz 2023-12-12 08:39:19 +01:00 committed by GitHub
parent 8dfb29c91d
commit ffdde952fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -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)

View File

@ -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;