IDEMPIERE-3378:AD_Package_Exp_Detail should use EntityType column to refer AD_EntityType

This commit is contained in:
hieplq 2017-06-01 19:15:38 +07:00
parent b97d1d670a
commit fb3977af88
1 changed files with 4 additions and 1 deletions

View File

@ -38,6 +38,7 @@ import org.compiere.model.GridTab;
import org.compiere.model.GridTable; import org.compiere.model.GridTable;
import org.compiere.model.GridWindow; import org.compiere.model.GridWindow;
import org.compiere.model.GridWindowVO; import org.compiere.model.GridWindowVO;
import org.compiere.model.I_AD_EntityType;
import org.compiere.model.MColumn; import org.compiere.model.MColumn;
import org.compiere.model.MLocation; import org.compiere.model.MLocation;
import org.compiere.model.MQuery; import org.compiere.model.MQuery;
@ -479,7 +480,9 @@ public class GridTabCSVExporter implements IGridTabExporter
if (DisplayType.isLookup(column.getAD_Reference_ID())) { if (DisplayType.isLookup(column.getAD_Reference_ID())) {
// resolve to identifier - search for value first, if not search for name - if not use the ID // resolve to identifier - search for value first, if not search for name - if not use the ID
String foreignTable = column.getReferenceTableName(); String foreignTable = column.getReferenceTableName();
if ( ! ("AD_Language".equals(foreignTable) || "AD_EntityType".equals(foreignTable) || "AD_Ref_List".equals(foreignTable))) { if ("AD_EntityType".equals(foreignTable) && I_AD_EntityType.COLUMNNAME_AD_EntityType_ID.equals(column.getColumnName())){
name.append("[EntityType]"); // ColumnName is unique value IDEMPIERE-3375
}else if ( ! ("AD_Language".equals(foreignTable) || "AD_EntityType".equals(foreignTable) || "AD_Ref_List".equals(foreignTable))) {
MTable fTable = MTable.get(Env.getCtx(), foreignTable); MTable fTable = MTable.get(Env.getCtx(), foreignTable);
// Hardcoded / do not check for Value on AD_Org, AD_User and AD_Ref_List, must use name for these two tables // Hardcoded / do not check for Value on AD_Org, AD_User and AD_Ref_List, must use name for these two tables
if (! ("AD_Org".equals(foreignTable) || "AD_User".equals(foreignTable)) && fTable.getColumn("Value") != null) { if (! ("AD_Org".equals(foreignTable) || "AD_User".equals(foreignTable)) && fTable.getColumn("Value") != null) {