From 6716cace06bdc07e24455ec2d0895e89d63a85bb Mon Sep 17 00:00:00 2001 From: hengsin Date: Thu, 11 May 2023 18:37:37 +0800 Subject: [PATCH] IDEMPIERE-5718 PoFiller.setTableReference sometime failed to load MColumn instance (#1831) --- org.adempiere.pipo/src/org/adempiere/pipo2/PoFiller.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PoFiller.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PoFiller.java index 0d3720645c..586727c82a 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PoFiller.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PoFiller.java @@ -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) {