IDEMPIERE-5567 Support of UUID as Key (FHCA-4195) (#1985)

- Fix issue caused by last changes - the *SelectionGrid fields are not working because they don't have a formal Reference
This commit is contained in:
Carlos Ruiz 2023-09-01 04:41:41 +02:00 committed by GitHub
parent fd986b4130
commit eee6f449c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 11 deletions

View File

@ -535,7 +535,8 @@ public final class DisplayType
/**
* Returns true if DisplayType is a VLookup (List, Table, TableDir, Search).
* (stored as Integer)
* (stored as Integer or multi-ID string separated by commas)
* The column must have the lookup defined in AD_Reference_Value_ID
* @param displayType Display Type
* @return true if Lookup
*/
@ -548,9 +549,7 @@ public final class DisplayType
|| displayType == RadiogroupList
|| displayType == ChosenMultipleSelectionTable
|| displayType == ChosenMultipleSelectionSearch
|| displayType == ChosenMultipleSelectionList
|| displayType == SingleSelectionGrid
|| displayType == MultipleSelectionGrid)
|| displayType == ChosenMultipleSelectionList)
return true;
//not custom type, don't have to check factory

View File

@ -1004,10 +1004,8 @@ public class MoveClient extends SvrProcess {
if ( ! (key instanceof Number && ((Number)key).intValue() == 0 && ("Parent_ID".equalsIgnoreCase(columnName) || "Node_ID".equalsIgnoreCase(columnName))) // Parent_ID/Node_ID=0 is valid
&& (key instanceof String || (key instanceof Number && ((Number)key).intValue() >= MTable.MAX_OFFICIAL_ID) || p_IsCopyClient)) {
Object convertedId = null;
if ( column.getAD_Reference_ID() == DisplayType.ChosenMultipleSelectionSearch
|| column.getAD_Reference_ID() == DisplayType.ChosenMultipleSelectionTable
|| column.getAD_Reference_ID() == DisplayType.SingleSelectionGrid
|| column.getAD_Reference_ID() == DisplayType.MultipleSelectionGrid) {
if (DisplayType.isMultiID(column.getAD_Reference_ID())) {
// multiple IDs or UUIDs separated by commas
String[] multiKeys = ((String)key).split(",");
for (String multiKey : multiKeys) {
@ -1168,8 +1166,8 @@ public class MoveClient extends SvrProcess {
return true;
}
}
if ("AD_ChangeLog".equalsIgnoreCase(tableName)) {
// skip orphan records in AD_ChangeLog, can be log of deleted records, skip
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
return true;
}
return false;

View File

@ -292,7 +292,7 @@ public class PoExporter {
addTableReference(columnName, tableName, new AttributesImpl());
} else if (DisplayType.isList(displayType)) {
add(columnName, "", new AttributesImpl());
} else if (DisplayType.isLookup(displayType)) {
} else if (DisplayType.isLookup(displayType) || DisplayType.isMultiID(displayType)) {
String tableName = null;
if (("Record_ID".equalsIgnoreCase(columnName) || "Record_UU".equalsIgnoreCase(columnName)) && po.get_ColumnIndex("AD_Table_ID") >= 0) {
int AD_Table_ID = po.get_ValueAsInt("AD_Table_ID");