IDEMPIERE-6017 Move/Copy Client failing when there are Record_ID references for AD_ClientInfo or AD_OrgInfo (#2214)

- improve discovery of key column
- improve avoiding block when the target column is bigger and can hold the source column
This commit is contained in:
Carlos Ruiz 2024-01-28 11:02:54 +01:00
parent 5705474223
commit 22e22fa976
2 changed files with 4 additions and 4 deletions

View File

@ -504,7 +504,7 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport
} // getKeyColumns } // getKeyColumns
/** /**
* @return true if table has single key column and the key column name ends with _ID. * @return true if table has single key column and the key column name is the same as the table name plus _ID.
*/ */
public boolean isIDKeyTable() public boolean isIDKeyTable()
{ {

View File

@ -534,8 +534,8 @@ public class MoveClient extends SvrProcess {
p_errorList.add("Column " + tableName + "." + columnName + " has different type in dictionary, external: " + refID + ", local: " + localColumn.getAD_Reference_ID()); p_errorList.add("Column " + tableName + "." + columnName + " has different type in dictionary, external: " + refID + ", local: " + localColumn.getAD_Reference_ID());
} }
// inform blocking if lengths are different // inform blocking if external length is bigger than local
if (length != localColumn.getFieldLength()) { if (length > localColumn.getFieldLength()) {
p_errorList.add("Column " + tableName + "." + columnName + " has different length in dictionary, external: " + length + ", local: " + localColumn.getFieldLength()); p_errorList.add("Column " + tableName + "." + columnName + " has different length in dictionary, external: " + length + ", local: " + localColumn.getFieldLength());
} }
@ -1353,7 +1353,7 @@ public class MoveClient extends SvrProcess {
String uuidCol = PO.getUUIDColumnName(tableName); String uuidCol = PO.getUUIDColumnName(tableName);
MTable table = MTable.get(getCtx(), tableName); MTable table = MTable.get(getCtx(), tableName);
String remoteUUID = null; String remoteUUID = null;
if (table.isUUIDKeyTable()) { if (! table.isIDKeyTable()) {
remoteUUID = foreign_Key.toString(); remoteUUID = foreign_Key.toString();
} else { } else {
StringBuilder sqlRemoteUUSB = new StringBuilder() StringBuilder sqlRemoteUUSB = new StringBuilder()