IDEMPIERE-78 Error using tables terminated in TO

This commit is contained in:
Carlos Ruiz 2011-09-28 09:37:36 -05:00
parent 083b9dfc49
commit ebb3dec44e
2 changed files with 12 additions and 10 deletions

View File

@ -510,6 +510,9 @@ public class GridFieldVO implements Serializable
lookupInfo = MLookupFactory.getLookupInfo (ctx, WindowNo, AD_Column_ID, displayType,
Env.getLanguage(ctx), ColumnName, AD_Reference_Value_ID,
IsParent, ValidationCode);
if (lookupInfo == null)
displayType = DisplayType.ID;
else
lookupInfo.InfoFactoryClass = this.InfoFactoryClass;
}
catch (Exception e) // Cannot create Lookup

View File

@ -243,20 +243,19 @@ public class MQuery implements Serializable
return "C_DocType_ID";
if (columnName.equals("Bill_BPartner_ID"))
return "C_BPartner_ID";
if (columnName.equals("Bill_Location_ID"))
if (columnName.equals("Bill_Location_ID") || columnName.equals("BillTo_ID"))
return "C_BPartner_Location_ID";
if (columnName.equals("Account_ID"))
return "C_ElementValue_ID";
if (columnName.equals("C_LocFrom_ID") || columnName.equals("C_LocTo_ID"))
return "C_Location_ID";
// Fix "*_To" columns
if (columnName.toUpperCase().endsWith("TO_ID")) {
return columnName.substring(0, columnName.length()-5)+"_ID";
}
if (columnName.toUpperCase().endsWith("_TO_ID")) {
return columnName.substring(0, columnName.length()-6)+"_ID";
}
if (columnName.equals("AD_OrgBP_ID") || columnName.equals("AD_OrgTrx_ID"))
if (columnName.equals("C_UOM_To_ID"))
return "C_UOM";
if (columnName.equals("M_AttributeSetInstanceTo_ID"))
return "M_AttributeSetInstance";
if (columnName.equals("M_LocatorTo_ID"))
return "M_Locator";
if (columnName.equals("AD_OrgBP_ID") || columnName.equals("AD_OrgTrx_ID") || columnName.equals("AD_OrgTo_ID"))
return "AD_Org_ID";
// See also GridTab.validateQuery
//