From 8eaac67d66bf07046e03f249a161212395c979de Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Thu, 1 Oct 2009 05:30:14 +0000 Subject: [PATCH] [ 2871042 ] Activity Control Report - broken report https://sourceforge.net/tracker/?func=detail&atid=934929&aid=2871042&group_id=176962 Also i have modified DataEngine to give us proper error message in future, when we will have columns with displayType=Table but no Reference Value --- base/src/org/compiere/print/DataEngine.java | 9 +++++++++ .../354a-trunk/oracle/590_2871042_AC_Broken_Report.sql | 4 ++++ .../postgresql/590_2871042_AC_Broken_Report.sql | 4 ++++ 3 files changed, 17 insertions(+) create mode 100644 migration/354a-trunk/oracle/590_2871042_AC_Broken_Report.sql create mode 100644 migration/354a-trunk/postgresql/590_2871042_AC_Broken_Report.sql diff --git a/base/src/org/compiere/print/DataEngine.java b/base/src/org/compiere/print/DataEngine.java index f3b41d8afb..6a103d7d14 100644 --- a/base/src/org/compiere/print/DataEngine.java +++ b/base/src/org/compiere/print/DataEngine.java @@ -25,6 +25,7 @@ import java.util.ArrayList; import java.util.Properties; import java.util.logging.Level; +import org.adempiere.exceptions.AdempiereException; import org.compiere.model.MLookupFactory; import org.compiere.model.MQuery; import org.compiere.model.MRole; @@ -354,6 +355,11 @@ public class DataEngine log.warning(ColumnName + " - virtual column not allowed with this Display type"); continue; } + if (AD_Reference_Value_ID <= 0) + { + log.warning(ColumnName + " - AD_Reference_Value_ID not set"); + continue; + } TableReference tr = getTableReference(AD_Reference_Value_ID); String display = tr.DisplayColumn; // => A.Name AS AName, Table.ID, @@ -702,6 +708,9 @@ public class DataEngine */ public static TableReference getTableReference (int AD_Reference_Value_ID) { + if (AD_Reference_Value_ID <= 0) + throw new IllegalArgumentException("AD_Reference_Value_ID <= 0"); + // TableReference tr = new TableReference(); // String SQL = "SELECT t.TableName, ck.ColumnName AS KeyColumn," // 1..2 diff --git a/migration/354a-trunk/oracle/590_2871042_AC_Broken_Report.sql b/migration/354a-trunk/oracle/590_2871042_AC_Broken_Report.sql new file mode 100644 index 0000000000..569689ee69 --- /dev/null +++ b/migration/354a-trunk/oracle/590_2871042_AC_Broken_Report.sql @@ -0,0 +1,4 @@ +-- Oct 1, 2009 8:26:29 AM EEST +UPDATE AD_Column SET AD_Reference_ID=19,Updated=TO_DATE('2009-10-01 08:26:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=53810 +; + diff --git a/migration/354a-trunk/postgresql/590_2871042_AC_Broken_Report.sql b/migration/354a-trunk/postgresql/590_2871042_AC_Broken_Report.sql new file mode 100644 index 0000000000..5100143035 --- /dev/null +++ b/migration/354a-trunk/postgresql/590_2871042_AC_Broken_Report.sql @@ -0,0 +1,4 @@ +-- Oct 1, 2009 8:26:29 AM EEST +UPDATE AD_Column SET AD_Reference_ID=19,Updated=TO_TIMESTAMP('2009-10-01 08:26:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=53810 +; +