IDEMPIERE-1026 Button on table to create automatically the window (#775)
* IDEMPIERE-1026 Button on table to create automatically the window Set relevant fields for translation tabs * Set better order by for translation tables * Minor performance fix found when testing this - the callout is visiting the database even on null column
This commit is contained in:
parent
0b3e307d86
commit
53ef632ecc
|
@ -31,6 +31,8 @@ public class Callout_AD_Column extends CalloutEngine
|
||||||
{
|
{
|
||||||
public String columnName (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
|
public String columnName (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
|
||||||
{ // IDEMPIERE-1011 - dup code on MColumn.setmartDefaults
|
{ // IDEMPIERE-1011 - dup code on MColumn.setmartDefaults
|
||||||
|
if (value == null)
|
||||||
|
return "";
|
||||||
I_AD_Column column = GridTabWrapper.create(mTab, I_AD_Column.class);
|
I_AD_Column column = GridTabWrapper.create(mTab, I_AD_Column.class);
|
||||||
if (MColumn.isSuggestSelectionColumn(column.getColumnName(), true))
|
if (MColumn.isSuggestSelectionColumn(column.getColumnName(), true))
|
||||||
column.setIsSelectionColumn(true);
|
column.setIsSelectionColumn(true);
|
||||||
|
|
|
@ -180,7 +180,7 @@ public class CreateWindowFromTable extends SvrProcess
|
||||||
tab.setAD_Table_ID(p_AD_Table_ID);
|
tab.setAD_Table_ID(p_AD_Table_ID);
|
||||||
tab.setTabLevel(p_TabLevel);
|
tab.setTabLevel(p_TabLevel);
|
||||||
tab.setIsSingleRow(true); //Default
|
tab.setIsSingleRow(true); //Default
|
||||||
|
|
||||||
//Set order by
|
//Set order by
|
||||||
if (table.columnExistsInDB("Value"))
|
if (table.columnExistsInDB("Value"))
|
||||||
tab.setOrderByClause(table.getTableName() + ".Value");
|
tab.setOrderByClause(table.getTableName() + ".Value");
|
||||||
|
@ -189,6 +189,13 @@ public class CreateWindowFromTable extends SvrProcess
|
||||||
else
|
else
|
||||||
tab.setOrderByClause(table.getTableName() + ".Created DESC");
|
tab.setOrderByClause(table.getTableName() + ".Created DESC");
|
||||||
|
|
||||||
|
if (table.getTableName().toLowerCase().endsWith("_trl")) {
|
||||||
|
tab.setIsTranslationTab(true);
|
||||||
|
tab.setIsInsertRecord(false);
|
||||||
|
if (table.columnExistsInDB("AD_Language"))
|
||||||
|
tab.setOrderByClause(table.getTableName() + ".AD_Language");
|
||||||
|
}
|
||||||
|
|
||||||
tab.saveEx();
|
tab.saveEx();
|
||||||
addLog(tab.getAD_Tab_ID(), null, null, "@AD_Tab_ID@: " + tab.getName(),
|
addLog(tab.getAD_Tab_ID(), null, null, "@AD_Tab_ID@: " + tab.getName(),
|
||||||
tab.get_Table_ID(), tab.getAD_Tab_ID());
|
tab.get_Table_ID(), tab.getAD_Tab_ID());
|
||||||
|
|
Loading…
Reference in New Issue