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
This commit is contained in:
Carlos Ruiz 2013-08-23 19:29:59 -05:00
parent 7d12418fc3
commit e6337d1837
3 changed files with 4 additions and 4 deletions

View File

@ -312,7 +312,7 @@ public class ColumnElementHandler extends AbstractElementHandler {
filler.add("AD_Column_ID", new AttributesImpl()); filler.add("AD_Column_ID", new AttributesImpl());
filler.addString("IsSyncDatabase", "Y", 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()); filler.addTableReference("AD_Reference_Value_ID", "AD_Reference", new AttributesImpl());
excludes.add("IsSyncDatabase"); excludes.add("IsSyncDatabase");

View File

@ -159,7 +159,7 @@ public class PoExporter {
} }
public void addTableReference(String columnName, String tableName, AttributesImpl atts) { 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); addTableReference(columnName, tableName, id, atts);
} }

View File

@ -72,9 +72,9 @@ public class ReferenceUtils {
String value = Integer.toString(id); String value = Integer.toString(id);
return value; 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"); atts.addAttribute("", "", "reference", "CDATA", "id");
return ""; return "";
} }