From 1749154acb7f1cf61066b6e0d9bd58f7bc75007e Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 4 Dec 2023 03:34:59 +0100 Subject: [PATCH] IDEMPIERE-5567 Support of UUID as Key (FHCA-4195) (#2125) * IDEMPIERE-5567 Support of UUID as Key (FHCA-4195) - Fix PO.get_Translation failing for UUID tables * - fix verification of zero ID --- org.adempiere.base/src/org/compiere/model/PO.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/PO.java b/org.adempiere.base/src/org/compiere/model/PO.java index 23eb57341d..564fe7a4df 100644 --- a/org.adempiere.base/src/org/compiere/model/PO.java +++ b/org.adempiere.base/src/org/compiere/model/PO.java @@ -2220,9 +2220,12 @@ public abstract class PO { // // Check if columnName, AD_Language is valid or table support translation (has 1 PK) => error - if (columnName == null || AD_Language == null - || m_IDs.length > 1 || m_IDs[0].equals(I_ZERO) - || !(m_IDs[0] instanceof Integer)) + if ( columnName == null + || AD_Language == null + || m_IDs.length > 1 + || (m_IDs[0] instanceof Integer && m_IDs[0].equals(I_ZERO)) + || (m_IDs[0] instanceof String && Util.isEmpty((String)m_IDs[0])) + || !(m_IDs[0] instanceof Integer || m_IDs[0] instanceof String)) { throw new IllegalArgumentException("ColumnName=" + columnName + ", AD_Language=" + AD_Language