From e6337d183764ae791c5f8c89a347770b9b741e19 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 23 Aug 2013 19:29:59 -0500 Subject: [PATCH] Troubleshoot 2pack for IDEMPIERE-1265 Related to IDEMPIERE-1178 2Pack was exporting wrongly AD_ReportView_ID=NULL as a zero value Also AD_Table_ID was being exported as NULL on columns --- .../src/org/adempiere/pipo2/handler/ColumnElementHandler.java | 2 +- org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java | 2 +- .../src/org/adempiere/pipo2/ReferenceUtils.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ColumnElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ColumnElementHandler.java index 5a77931450..8a0b8da4be 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ColumnElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/ColumnElementHandler.java @@ -312,7 +312,7 @@ public class ColumnElementHandler extends AbstractElementHandler { filler.add("AD_Column_ID", new AttributesImpl()); filler.addString("IsSyncDatabase", "Y", new AttributesImpl()); - filler.addTableReference("AD_Table", "TableName", new AttributesImpl()); + filler.addTableReference("AD_Table_ID", "TableName", new AttributesImpl()); filler.addTableReference("AD_Reference_Value_ID", "AD_Reference", new AttributesImpl()); excludes.add("IsSyncDatabase"); diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java b/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java index 558b689d0e..0c147f733c 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PoExporter.java @@ -159,7 +159,7 @@ public class PoExporter { } public void addTableReference(String columnName, String tableName, AttributesImpl atts) { - int id = po.get_Value(columnName) != null ? (Integer)po.get_Value(columnName) : 0; + int id = po.get_Value(columnName) != null ? (Integer)po.get_Value(columnName) : -1; addTableReference(columnName, tableName, id, atts); } diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/ReferenceUtils.java b/org.adempiere.pipo/src/org/adempiere/pipo2/ReferenceUtils.java index b520b02284..6fe91a5dc9 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/ReferenceUtils.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/ReferenceUtils.java @@ -72,9 +72,9 @@ public class ReferenceUtils { String value = Integer.toString(id); return value; } - else if (id == 0) + else if (id <= 0) { - //no id, should never happen + //no id, -1 indicates it was read a null atts.addAttribute("", "", "reference", "CDATA", "id"); return ""; }