From 5dfd3cca8fa667343ae400ae0c1945a6133a7165 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 13 Sep 2023 12:37:27 +0200 Subject: [PATCH] IDEMPIERE-5567 Support of UUID as Key (FHCA-4195) (#2006) - fix for broken PackIn on AD_Menu.Parent_ID --- .../src/org/adempiere/pipo2/PoFiller.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) 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)