diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PoFiller.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PoFiller.java index ed7829154d..88a1a674c6 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PoFiller.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PoFiller.java @@ -181,25 +181,25 @@ public class PoFiller{ String value = e.contents.toString(); String columnName = qName; if (value != null && value.trim().length() > 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; - } - boolean isMulti = DisplayType.isMultiID(col.getAD_Reference_ID()); - Object id; - if (isMulti) - id = ReferenceUtils.resolveReferenceMulti(ctx.ctx, e, po.get_TrxName()); - else - id = ReferenceUtils.resolveReference(ctx.ctx, e, po.get_TrxName()); - if (columnName.equals("AD_Client_ID") && ((Number)id).intValue() > 0) { - if (((Number)id).intValue() != Env.getAD_Client_ID(ctx.ctx)) { - return -1; - } - } 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; + } + boolean isMulti = DisplayType.isMultiID(col.getAD_Reference_ID()); + Object id; + if (isMulti) + id = ReferenceUtils.resolveReferenceMulti(ctx.ctx, e, po.get_TrxName()); + else + id = ReferenceUtils.resolveReference(ctx.ctx, e, po.get_TrxName()); + if (columnName.equals("AD_Client_ID") && ((Number)id).intValue() > 0) { + if (((Number)id).intValue() != Env.getAD_Client_ID(ctx.ctx)) { + return -1; + } + } MTable foreignTable = null; String refTableName; if (isMulti)