IDEMPIERE-3409 Make separator used between identifier fields configurable (1004703)
This commit is contained in:
parent
18b795150a
commit
95cf3f19b3
|
@ -854,7 +854,11 @@ public class MLookupFactory
|
||||||
for (int i = 0; i < size; i++)
|
for (int i = 0; i < size; i++)
|
||||||
{
|
{
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
displayColumn.append(" ||'_'|| " );
|
{
|
||||||
|
displayColumn.append(" ||'")
|
||||||
|
.append(MSysConfig.getValue(MSysConfig.IDENTIFIER_SEPARATOR, "_", Env.getAD_Client_ID(Env.getCtx())))
|
||||||
|
.append("'|| " );
|
||||||
|
}
|
||||||
LookupDisplayColumn ldc = (LookupDisplayColumn)list.get(i);
|
LookupDisplayColumn ldc = (LookupDisplayColumn)list.get(i);
|
||||||
StringBuilder msg = new StringBuilder().append(TableName).append(".").append(ldc.ColumnName);
|
StringBuilder msg = new StringBuilder().append(TableName).append(".").append(ldc.ColumnName);
|
||||||
String columnSQL = ldc.IsVirtual ? ldc.ColumnSQL : msg.toString();
|
String columnSQL = ldc.IsVirtual ? ldc.ColumnSQL : msg.toString();
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class MSysConfig extends X_AD_SysConfig
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = -3599797130058840418L;
|
private static final long serialVersionUID = 8251867765594097812L;
|
||||||
|
|
||||||
public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION";
|
public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION";
|
||||||
public static final String ALERT_SEND_ATTACHMENT_AS_XLS = "ALERT_SEND_ATTACHMENT_AS_XLS";
|
public static final String ALERT_SEND_ATTACHMENT_AS_XLS = "ALERT_SEND_ATTACHMENT_AS_XLS";
|
||||||
|
@ -85,6 +85,7 @@ public class MSysConfig extends X_AD_SysConfig
|
||||||
public static final String GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS = "GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS";
|
public static final String GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS = "GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS";
|
||||||
public static final String HTML_REPORT_THEME = "HTML_REPORT_THEME";
|
public static final String HTML_REPORT_THEME = "HTML_REPORT_THEME";
|
||||||
public static final String IBAN_VALIDATION = "IBAN_VALIDATION" ;
|
public static final String IBAN_VALIDATION = "IBAN_VALIDATION" ;
|
||||||
|
public static final String IDENTIFIER_SEPARATOR = "IDENTIFIER_SEPARATOR" ;
|
||||||
public static final String Invoice_ReverseUseNewNumber = "Invoice_ReverseUseNewNumber";
|
public static final String Invoice_ReverseUseNewNumber = "Invoice_ReverseUseNewNumber";
|
||||||
public static final String JASPER_SWAP_MAX_PAGES = "JASPER_SWAP_MAX_PAGES";
|
public static final String JASPER_SWAP_MAX_PAGES = "JASPER_SWAP_MAX_PAGES";
|
||||||
public static final String LASTRUN_RECORD_COUNT = "LASTRUN_RECORD_COUNT";
|
public static final String LASTRUN_RECORD_COUNT = "LASTRUN_RECORD_COUNT";
|
||||||
|
|
|
@ -68,6 +68,7 @@ import org.compiere.model.MLookupFactory;
|
||||||
import org.compiere.model.MLookupInfo;
|
import org.compiere.model.MLookupInfo;
|
||||||
import org.compiere.model.MProcess;
|
import org.compiere.model.MProcess;
|
||||||
import org.compiere.model.MRole;
|
import org.compiere.model.MRole;
|
||||||
|
import org.compiere.model.MSysConfig;
|
||||||
import org.compiere.model.MTable;
|
import org.compiere.model.MTable;
|
||||||
import org.compiere.model.X_AD_InfoColumn;
|
import org.compiere.model.X_AD_InfoColumn;
|
||||||
import org.compiere.util.DB;
|
import org.compiere.util.DB;
|
||||||
|
@ -464,12 +465,13 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
|
||||||
|
|
||||||
boolean splitValue = false;
|
boolean splitValue = false;
|
||||||
if (m_count <= 0) {
|
if (m_count <= 0) {
|
||||||
String[] values = queryValue.split("[_]");
|
String separator = MSysConfig.getValue(MSysConfig.IDENTIFIER_SEPARATOR, "_", Env.getAD_Client_ID(Env.getCtx()));
|
||||||
|
String[] values = queryValue.split("[" + separator.trim()+"]");
|
||||||
if (values.length == 2) {
|
if (values.length == 2) {
|
||||||
splitValue = true;
|
splitValue = true;
|
||||||
for(int i = 0; i < values.length && i < identifiers.size(); i++) {
|
for(int i = 0; i < values.length && i < identifiers.size(); i++) {
|
||||||
WEditor editor = identifiers.get(i);
|
WEditor editor = identifiers.get(i);
|
||||||
editor.setValue(values[i]);
|
editor.setValue(values[i].trim());
|
||||||
}
|
}
|
||||||
testCount(false);
|
testCount(false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue