From f0c87202b489ea45ad4eea20fffb7c2fcb38d922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Tak=C3=A1cs?= <93127072+PeterTakacs300@users.noreply.github.com> Date: Fri, 9 Jun 2023 10:36:18 +0200 Subject: [PATCH] IDEMPIERE-5407 - Fix Wrong getIdColumnName Validation (#1893) * IDEMPIERE-5407 - Fix Wrong getIdColumnName Validation * IDEMPIERE-5407 - patch by Carlos --- org.adempiere.base/src/org/compiere/model/MRole.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MRole.java b/org.adempiere.base/src/org/compiere/model/MRole.java index 7461e0f347..fbf2e7aca9 100644 --- a/org.adempiere.base/src/org/compiere/model/MRole.java +++ b/org.adempiere.base/src/org/compiere/model/MRole.java @@ -968,7 +968,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport MTable table = MTable.get(getCtx(), tableName); if (table == null) return false; - return MTable.get(getCtx(), tableName).isView(); + return table.isView(); } private String getIdColumnName(String tableName) @@ -977,7 +977,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport MTable table = MTable.get(getCtx(), tableName); if (table == null) return null; - if (MTable.get(getCtx(), tableName).columnExists(colkey.toString())) + if (table.getColumnIndex(colkey.toString()) >= 0) return colkey.toString(); return null; }