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
/**
* @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()
{

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());
}
// inform blocking if lengths are different
if (length != localColumn.getFieldLength()) {
// inform blocking if external length is bigger than local
if (length > 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);
MTable table = MTable.get(getCtx(), tableName);
String remoteUUID = null;
if (table.isUUIDKeyTable()) {
if (! table.isIDKeyTable()) {
remoteUUID = foreign_Key.toString();
} else {
StringBuilder sqlRemoteUUSB = new StringBuilder()