IDEMPIERE-5718 PoFiller.setTableReference sometime failed to load MColumn instance (#1831)

This commit is contained in:
hengsin 2023-05-11 18:37:37 +08:00 committed by GitHub
parent ae19cbe91a
commit 6716cace06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -189,6 +189,12 @@ public class PoFiller{
}
if (po.get_ColumnIndex(columnName) >= 0) {
MColumn col = MColumn.get(ctx.ctx, po.get_TableName(), columnName, po.get_TrxName());
if (col == null) {
POInfo poInfo = POInfo.getPOInfo(ctx.ctx, po.get_Table_ID(), po.get_TrxName());
col = new MColumn(ctx.ctx, poInfo.getAD_Column_ID(columnName), po.get_TrxName());
if (col.get_ID() == 0)
return -1;
}
MTable foreignTable = null;
String refTableName = col.getReferenceTableName();
if (refTableName != null) {