IDEMPIERE-236 Centralization of hardcoded IDs (#1429)

* IDEMPIERE-236 Centralization of hardcoded IDs

* IDEMPIERE-236 Centralization of hardcoded IDs
This commit is contained in:
Carlos Ruiz 2022-08-09 16:12:54 +02:00 committed by GitHub
parent c92d1b3896
commit 5bd3af0d2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 51 additions and 41 deletions

View File

@ -398,7 +398,7 @@ public class CalloutInvoice extends CalloutEngine
} }
mTab.setValue("M_AttributeSetInstance_ID", null); mTab.setValue("M_AttributeSetInstance_ID", null);
mTab.setValue("S_ResourceAssignment_ID", null); mTab.setValue("S_ResourceAssignment_ID", null);
mTab.setValue("C_UOM_ID", Integer.valueOf(100)); // EA mTab.setValue("C_UOM_ID", Integer.valueOf(SystemIDs.C_UOM_EACH)); // EA
Env.setContext(ctx, WindowNo, "DiscountSchema", "N"); Env.setContext(ctx, WindowNo, "DiscountSchema", "N");
String sql = "SELECT ChargeAmt FROM C_Charge WHERE C_Charge_ID=?"; String sql = "SELECT ChargeAmt FROM C_Charge WHERE C_Charge_ID=?";

View File

@ -872,7 +872,7 @@ public class CalloutOrder extends CalloutEngine
} }
mTab.setValue("M_AttributeSetInstance_ID", null); mTab.setValue("M_AttributeSetInstance_ID", null);
mTab.setValue("S_ResourceAssignment_ID", null); mTab.setValue("S_ResourceAssignment_ID", null);
mTab.setValue("C_UOM_ID", Integer.valueOf(100)); // EA mTab.setValue("C_UOM_ID", Integer.valueOf(SystemIDs.C_UOM_EACH)); // EA
Env.setContext(ctx, WindowNo, "DiscountSchema", "N"); Env.setContext(ctx, WindowNo, "DiscountSchema", "N");
String sql = "SELECT ChargeAmt FROM C_Charge WHERE C_Charge_ID=?"; String sql = "SELECT ChargeAmt FROM C_Charge WHERE C_Charge_ID=?";

View File

@ -127,7 +127,7 @@ public class RoleAccessUpdate extends SvrProcess
s_log.info("------------------"); s_log.info("------------------");
ProcessInfo pi = new ProcessInfo("Role Access Update", 295); ProcessInfo pi = new ProcessInfo("Role Access Update", 295);
pi.setAD_Client_ID(0); pi.setAD_Client_ID(0);
pi.setAD_User_ID(100); pi.setAD_User_ID(SystemIDs.USER_SUPERUSER);
RoleAccessUpdate rau = new RoleAccessUpdate(); RoleAccessUpdate rau = new RoleAccessUpdate();
rau.startProcess(Env.getCtx(), pi, null); rau.startProcess(Env.getCtx(), pi, null);

View File

@ -30,6 +30,7 @@ import java.util.logging.Level;
import org.compiere.Adempiere; import org.compiere.Adempiere;
import org.compiere.model.MPInstance; import org.compiere.model.MPInstance;
import org.compiere.model.SystemIDs;
import org.compiere.process.ProcessCall; import org.compiere.process.ProcessCall;
import org.compiere.process.ProcessInfo; import org.compiere.process.ProcessInfo;
import org.compiere.process.ProcessInfoUtil; import org.compiere.process.ProcessInfoUtil;
@ -71,7 +72,7 @@ public class PackInFolderApplication implements IApplication {
String directory = commandlineArgs[0]; String directory = commandlineArgs[0];
ProcessInfo pi = new ProcessInfo("PackInFolder", 200099); ProcessInfo pi = new ProcessInfo("PackInFolder", 200099);
pi.setAD_Client_ID(0); pi.setAD_Client_ID(0);
pi.setAD_User_ID(100); pi.setAD_User_ID(SystemIDs.USER_SUPERUSER);
MPInstance instance = new MPInstance(ctx, 200099, 0); MPInstance instance = new MPInstance(ctx, 200099, 0);
instance.saveEx(); instance.saveEx();
instance.createParameter(10, "Folder", directory); instance.createParameter(10, "Folder", directory);

View File

@ -17,6 +17,7 @@ import java.util.logging.Level;
import org.adempiere.util.ProcessUtil; import org.adempiere.util.ProcessUtil;
import org.compiere.Adempiere; import org.compiere.Adempiere;
import org.compiere.model.SystemIDs;
import org.compiere.process.ProcessInfo; import org.compiere.process.ProcessInfo;
import org.compiere.util.CLogMgt; import org.compiere.util.CLogMgt;
import org.compiere.util.Env; import org.compiere.util.Env;
@ -46,7 +47,7 @@ public class PostMigrationApplication implements IApplication {
private void checkSequence() { private void checkSequence() {
ProcessInfo pi = new ProcessInfo("Sequence Check", 258); ProcessInfo pi = new ProcessInfo("Sequence Check", 258);
pi.setAD_Client_ID(0); pi.setAD_Client_ID(0);
pi.setAD_User_ID(100); pi.setAD_User_ID(SystemIDs.USER_SUPERUSER);
pi.setClassName("org.compiere.process.SequenceCheck"); pi.setClassName("org.compiere.process.SequenceCheck");
ProcessUtil.startJavaProcess(Env.getCtx(), pi, null); ProcessUtil.startJavaProcess(Env.getCtx(), pi, null);
} }
@ -54,7 +55,7 @@ public class PostMigrationApplication implements IApplication {
private void roleAccessUpdate() { private void roleAccessUpdate() {
ProcessInfo pi = new ProcessInfo("Role Access Update", 295); ProcessInfo pi = new ProcessInfo("Role Access Update", 295);
pi.setAD_Client_ID(0); pi.setAD_Client_ID(0);
pi.setAD_User_ID(100); pi.setAD_User_ID(SystemIDs.USER_SUPERUSER);
pi.setClassName("org.compiere.process.RoleAccessUpdate"); pi.setClassName("org.compiere.process.RoleAccessUpdate");
ProcessUtil.startJavaProcess(Env.getCtx(), pi, null); ProcessUtil.startJavaProcess(Env.getCtx(), pi, null);
} }
@ -62,7 +63,7 @@ public class PostMigrationApplication implements IApplication {
private void addMissingTranslation() { private void addMissingTranslation() {
ProcessInfo pi = new ProcessInfo("Synchronize Terminology", 172); ProcessInfo pi = new ProcessInfo("Synchronize Terminology", 172);
pi.setAD_Client_ID(0); pi.setAD_Client_ID(0);
pi.setAD_User_ID(100); pi.setAD_User_ID(SystemIDs.USER_SUPERUSER);
pi.setClassName("org.compiere.process.SynchronizeTerminology"); pi.setClassName("org.compiere.process.SynchronizeTerminology");
ProcessUtil.startJavaProcess(Env.getCtx(), pi, null); ProcessUtil.startJavaProcess(Env.getCtx(), pi, null);
} }

View File

@ -24,7 +24,10 @@ import java.util.Properties;
import java.util.logging.Level; import java.util.logging.Level;
import org.compiere.model.I_AD_ImpFormat; import org.compiere.model.I_AD_ImpFormat;
import static org.compiere.model.SystemIDs.*; import org.compiere.model.I_I_BPartner;
import org.compiere.model.I_I_ElementValue;
import org.compiere.model.I_I_Product;
import org.compiere.model.I_I_ReportLine;
import org.compiere.model.X_AD_ImpFormat; import org.compiere.model.X_AD_ImpFormat;
import org.compiere.model.X_I_GLJournal; import org.compiere.model.X_I_GLJournal;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
@ -152,24 +155,24 @@ public final class ImpFormat
m_tableUniqueParent = ""; m_tableUniqueParent = "";
m_tableUniqueChild = ""; m_tableUniqueChild = "";
if (m_AD_Table_ID == TABLE_I_PRODUCT) // I_Product if (m_AD_Table_ID == I_I_Product.Table_ID) // I_Product
{ {
m_tableUnique1 = "UPC"; // UPC = unique m_tableUnique1 = "UPC"; // UPC = unique
m_tableUnique2 = "Value"; m_tableUnique2 = "Value";
m_tableUniqueChild = "VendorProductNo"; // Vendor No may not be unique ! m_tableUniqueChild = "VendorProductNo"; // Vendor No may not be unique !
m_tableUniqueParent = "BPartner_Value"; // Makes it unique m_tableUniqueParent = "BPartner_Value"; // Makes it unique
} }
else if (m_AD_Table_ID == TABLE_I_BPARTNER) // I_BPartner else if (m_AD_Table_ID == I_I_BPartner.Table_ID) // I_BPartner
{ {
// gody: 20070113 to allow multiple contacts per BP // gody: 20070113 to allow multiple contacts per BP
// m_tableUnique1 = "Value"; // the key // m_tableUnique1 = "Value"; // the key
} }
else if (m_AD_Table_ID == TABLE_I_ELEMENTVALUE) // I_ElementValue else if (m_AD_Table_ID == I_I_ElementValue.Table_ID) // I_ElementValue
{ {
m_tableUniqueParent = "ElementName"; // the parent key m_tableUniqueParent = "ElementName"; // the parent key
m_tableUniqueChild = "Value"; // the key m_tableUniqueChild = "Value"; // the key
} }
else if (m_AD_Table_ID == TABLE_I_REPORTLINE) // I_ReportLine else if (m_AD_Table_ID == I_I_ReportLine.Table_ID) // I_ReportLine
{ {
m_tableUniqueParent = "ReportLineSetName"; // the parent key m_tableUniqueParent = "ReportLineSetName"; // the parent key
m_tableUniqueChild = "Name"; // the key m_tableUniqueChild = "Name"; // the key

View File

@ -377,8 +377,8 @@ public class MSystem extends X_AD_System
+ "FROM AD_User u" + "FROM AD_User u"
+ " INNER JOIN AD_User_Roles ur ON (u.AD_User_ID=ur.AD_User_ID) " + " INNER JOIN AD_User_Roles ur ON (u.AD_User_ID=ur.AD_User_ID) "
+ "WHERE u.AD_Client_ID<>11" // no Demo + "WHERE u.AD_Client_ID<>11" // no Demo
+ " AND u.AD_User_ID NOT IN (0,10,100)"; // no System/SuperUser + " AND u.AD_User_ID NOT IN (?,?,?)"; // no System/SuperUser
int internalUsers = DB.getSQLValue(null, sql); int internalUsers = DB.getSQLValue(null, sql, SystemIDs.USER_SYSTEM_DEPRECATED, SystemIDs.USER_SYSTEM, SystemIDs.USER_SUPERUSER);
setSupportUnits(internalUsers); setSupportUnits(internalUsers);
} // setInternalUsers } // setInternalUsers

View File

@ -30,12 +30,15 @@ public class SystemIDs
public final static int COLUMN_C_INVOICE_C_BPARTNER_ID = 3499; public final static int COLUMN_C_INVOICE_C_BPARTNER_ID = 3499;
public final static int COLUMN_C_INVOICE_C_CURRENCY_ID = 3505; public final static int COLUMN_C_INVOICE_C_CURRENCY_ID = 3505;
public final static int COLUMN_C_INVOICELINE_M_PRODUCT_ID = 3840; public final static int COLUMN_C_INVOICELINE_M_PRODUCT_ID = 3840;
public final static int COLUMN_C_ORDER_AD_ORG_ID = 2163;
public final static int COLUMN_C_ORDER_C_BPARTNER_ID = 2762;
public final static int COLUMN_C_PAYMENT_V_TENDERTYPE = 8416; public final static int COLUMN_C_PAYMENT_V_TENDERTYPE = 8416;
public final static int COLUMN_C_PAYSELECTIONCHECK_C_PAYSELECTION_ID = 7670; public final static int COLUMN_C_PAYSELECTIONCHECK_C_PAYSELECTION_ID = 7670;
public final static int COLUMN_FACT_ACCT_C_ACCTSCHEMA_ID = 2513; public final static int COLUMN_FACT_ACCT_C_ACCTSCHEMA_ID = 2513;
public final static int COLUMN_FACT_ACCT_M_PRODUCT_ID = 2527; public final static int COLUMN_FACT_ACCT_M_PRODUCT_ID = 2527;
public final static int COLUMN_M_MOVEMENTLINE_M_ATTRIBUTESETINSTANCE_ID = 8551; public final static int COLUMN_M_MOVEMENTLINE_M_ATTRIBUTESETINSTANCE_ID = 8551;
public final static int COLUMN_M_PRODUCT_M_ATTRIBUTESETINSTANCE_ID = 8418; public final static int COLUMN_M_PRODUCT_M_ATTRIBUTESETINSTANCE_ID = 8418;
public final static int COLUMN_M_REQUISITION_M_WAREHOUSE_ID = 11474;
public final static int COLUMN_S_RESOURCE_S_RESOURCETYPE_ID = 6851; public final static int COLUMN_S_RESOURCE_S_RESOURCETYPE_ID = 6851;
public final static int COLUMN_S_RESOURCEASSIGNMENT_S_RESOURCE_ID = 6826; public final static int COLUMN_S_RESOURCEASSIGNMENT_S_RESOURCE_ID = 6826;
public final static int COLUMN_WIZARDSTATUS = 200310; public final static int COLUMN_WIZARDSTATUS = 200310;
@ -44,6 +47,8 @@ public class SystemIDs
public final static int COUNTRY_US = 100; public final static int COUNTRY_US = 100;
public final static int COUNTRY_JAPAN = 216; public final static int COUNTRY_JAPAN = 216;
public final static int C_UOM_EACH = 100;
public final static int ELEMENT_AD_CLIENT_ID = 102; public final static int ELEMENT_AD_CLIENT_ID = 102;
public final static int ELEMENT_AD_ORG_ID = 113; public final static int ELEMENT_AD_ORG_ID = 113;
public final static int ELEMENT_CREATED = 245; public final static int ELEMENT_CREATED = 245;
@ -177,15 +182,6 @@ public class SystemIDs
public final static int REFERENCE_WIZARDSTATUS = 200003; public final static int REFERENCE_WIZARDSTATUS = 200003;
public final static int REFERENCE_YESNO = 319; public final static int REFERENCE_YESNO = 319;
public final static int TABLE_AD_TABLE = 100;
public final static int TABLE_AD_WF_PROCESS = 645;
public final static int TABLE_AD_WF_ACTIVITY = 644;
public final static int TABLE_I_PRODUCT = 532;
public final static int TABLE_I_BPARTNER = 533;
public final static int TABLE_I_ELEMENTVALUE = 534;
public final static int TABLE_I_REPORTLINE = 535;
public final static int TABLE_T_REPORT = 544;
public final static int TREE_MENUPRIMARY = 10; public final static int TREE_MENUPRIMARY = 10;
public final static int USER_SUPERUSER = 100; public final static int USER_SUPERUSER = 100;

View File

@ -16,8 +16,6 @@
*****************************************************************************/ *****************************************************************************/
package org.compiere.report; package org.compiere.report;
import static org.compiere.model.SystemIDs.TABLE_T_REPORT;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
@ -27,6 +25,7 @@ import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import org.compiere.model.I_C_ValidCombination; import org.compiere.model.I_C_ValidCombination;
import org.compiere.model.I_T_Report;
import org.compiere.model.MAcctSchemaElement; import org.compiere.model.MAcctSchemaElement;
import org.compiere.model.MPeriod; import org.compiere.model.MPeriod;
import org.compiere.model.MReportCube; import org.compiere.model.MReportCube;
@ -1809,7 +1808,7 @@ public class FinReport extends SvrProcess
// Create New // Create New
if (createNew) if (createNew)
{ {
int AD_Table_ID = TABLE_T_REPORT; // T_Report int AD_Table_ID = I_T_Report.Table_ID; // T_Report
pf = MPrintFormat.createFromTable(Env.getCtx(), AD_Table_ID); pf = MPrintFormat.createFromTable(Env.getCtx(), AD_Table_ID);
AD_PrintFormat_ID = pf.getAD_PrintFormat_ID(); AD_PrintFormat_ID = pf.getAD_PrintFormat_ID();
m_report.setAD_PrintFormat_ID(AD_PrintFormat_ID); m_report.setAD_PrintFormat_ID(AD_PrintFormat_ID);

View File

@ -57,6 +57,7 @@ import org.compiere.model.MSystem;
import org.compiere.model.MTable; import org.compiere.model.MTable;
import org.compiere.model.PO; import org.compiere.model.PO;
import org.compiere.model.POResultSet; import org.compiere.model.POResultSet;
import org.compiere.model.SystemIDs;
import org.compiere.process.ProcessInfo; import org.compiere.process.ProcessInfo;
import org.compiere.process.ProcessInfoParameter; import org.compiere.process.ProcessInfoParameter;
@ -239,8 +240,8 @@ public final class DB
.append(" EMail=").append(DB.TO_STRING(adminEMail)) .append(" EMail=").append(DB.TO_STRING(adminEMail))
.append(", EMailUser=").append(DB.TO_STRING(mailUser)) .append(", EMailUser=").append(DB.TO_STRING(mailUser))
.append(", EMailUserPW=").append(DB.TO_STRING(mailPassword)) .append(", EMailUserPW=").append(DB.TO_STRING(mailPassword))
.append(" WHERE AD_User_ID IN (0,100)"); .append(" WHERE AD_User_ID IN (?,?,?)");
no = DB.executeUpdate(sql.toString(), null); no = DB.executeUpdate(sql.toString(), new Object[]{SystemIDs.USER_SYSTEM_DEPRECATED, SystemIDs.USER_SYSTEM, SystemIDs.USER_SUPERUSER}, false, null);
if (log.isLoggable(Level.FINE)) log.fine("User #"+no); if (log.isLoggable(Level.FINE)) log.fine("User #"+no);
// //
try (FileOutputStream out = new FileOutputStream(envFile)) try (FileOutputStream out = new FileOutputStream(envFile))

View File

@ -376,7 +376,7 @@ public class Login
if (force) if (force)
{ {
Env.setContext(m_ctx, Env.AD_USER_NAME, "SuperUser"); Env.setContext(m_ctx, Env.AD_USER_NAME, "SuperUser");
Env.setContext(m_ctx, Env.AD_USER_ID, "100"); Env.setContext(m_ctx, Env.AD_USER_ID, SystemIDs.USER_SUPERUSER);
Env.setContext(m_ctx, "#AD_User_Description", "SuperUser Forced Login"); Env.setContext(m_ctx, "#AD_User_Description", "SuperUser Forced Login");
Env.setContext(m_ctx, Env.USER_LEVEL, "S "); // Format 'SCO' Env.setContext(m_ctx, Env.USER_LEVEL, "S "); // Format 'SCO'
Env.setContext(m_ctx, "#User_Client", "0"); // Format c1, c2, ... Env.setContext(m_ctx, "#User_Client", "0"); // Format c1, c2, ...

View File

@ -35,6 +35,7 @@ import org.adempiere.server.rpl.IImportProcessor;
import org.compiere.model.AdempiereProcessor; import org.compiere.model.AdempiereProcessor;
import org.compiere.model.MClient; import org.compiere.model.MClient;
import org.compiere.model.MOrgInfo; import org.compiere.model.MOrgInfo;
import org.compiere.model.SystemIDs;
import org.compiere.model.X_IMP_Processor_Type; import org.compiere.model.X_IMP_Processor_Type;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.TimeUtil; import org.compiere.util.TimeUtil;
@ -166,7 +167,7 @@ public class ReplicationProcessor extends AdempiereServer {
else if (mImportProcessor.getUpdatedBy() > 0) else if (mImportProcessor.getUpdatedBy() > 0)
AD_User_ID = mImportProcessor.getUpdatedBy(); AD_User_ID = mImportProcessor.getUpdatedBy();
else else
AD_User_ID = 100; //fall back to SuperUser AD_User_ID = SystemIDs.USER_SUPERUSER; //fall back to SuperUser
return AD_User_ID; return AD_User_ID;
} }

View File

@ -36,6 +36,7 @@ import org.compiere.model.MOrgInfo;
import org.compiere.model.MRole; import org.compiere.model.MRole;
import org.compiere.model.MTable; import org.compiere.model.MTable;
import org.compiere.model.MUser; import org.compiere.model.MUser;
import org.compiere.model.SystemIDs;
import org.compiere.util.DB; import org.compiere.util.DB;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.TimeUtil; import org.compiere.util.TimeUtil;
@ -122,7 +123,7 @@ public class AcctProcessor extends AdempiereServer
else if (m_model.getUpdatedBy() > 0) else if (m_model.getUpdatedBy() > 0)
AD_User_ID = m_model.getUpdatedBy(); AD_User_ID = m_model.getUpdatedBy();
else else
AD_User_ID = 100; //fall back to SuperUser AD_User_ID = SystemIDs.USER_SUPERUSER; //fall back to SuperUser
return AD_User_ID; return AD_User_ID;
} }

View File

@ -34,6 +34,7 @@ import org.compiere.model.MSystem;
import org.compiere.model.MUser; import org.compiere.model.MUser;
import org.compiere.model.PO; import org.compiere.model.PO;
import org.compiere.model.Query; import org.compiere.model.Query;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.TimeUtil; import org.compiere.util.TimeUtil;
@ -202,7 +203,7 @@ public abstract class AdempiereServer implements Runnable
else if (po.get_ValueAsInt("UpdatedBy") > 0) else if (po.get_ValueAsInt("UpdatedBy") > 0)
AD_User_ID = po.get_ValueAsInt("UpdatedBy"); AD_User_ID = po.get_ValueAsInt("UpdatedBy");
else else
AD_User_ID = 100; //fall back to SuperUser AD_User_ID = SystemIDs.USER_SUPERUSER; //fall back to SuperUser
return AD_User_ID; return AD_User_ID;
} }

View File

@ -54,6 +54,7 @@ import org.compiere.model.MSchedulerRecipient;
import org.compiere.model.MSession; import org.compiere.model.MSession;
import org.compiere.model.MUser; import org.compiere.model.MUser;
import org.compiere.model.PO; import org.compiere.model.PO;
import org.compiere.model.SystemIDs;
import org.compiere.print.MPrintFormat; import org.compiere.print.MPrintFormat;
import org.compiere.process.ProcessInfo; import org.compiere.process.ProcessInfo;
import org.compiere.process.ProcessInfoUtil; import org.compiere.process.ProcessInfoUtil;
@ -504,7 +505,7 @@ public class Scheduler extends AdempiereServer
else if (scheduler.getUpdatedBy() > 0) else if (scheduler.getUpdatedBy() > 0)
AD_User_ID = scheduler.getUpdatedBy(); AD_User_ID = scheduler.getUpdatedBy();
else else
AD_User_ID = 100; //fall back to SuperUser AD_User_ID = SystemIDs.USER_SUPERUSER; //fall back to SuperUser
return AD_User_ID; return AD_User_ID;
} }

View File

@ -47,6 +47,7 @@ import org.compiere.model.MDepositBatch;
import org.compiere.model.MLookup; import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory; import org.compiere.model.MLookupFactory;
import org.compiere.model.MPayment; import org.compiere.model.MPayment;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
import org.compiere.util.Env; import org.compiere.util.Env;
@ -166,7 +167,7 @@ public class WCreateFromDepositBatchUI extends CreateFromDepositBatch implements
lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_TenderType), DisplayType.List); lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_TenderType), DisplayType.List);
tenderTypeField = new WTableDirEditor (MPayment.COLUMNNAME_TenderType,false,false,true,lookup); tenderTypeField = new WTableDirEditor (MPayment.COLUMNNAME_TenderType,false,false,true,lookup);
lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 3499, DisplayType.Search); lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, SystemIDs.COLUMN_C_INVOICE_C_BPARTNER_ID, DisplayType.Search);
bPartnerLookup = new WSearchEditor ("C_BPartner_ID", false, false, true, lookup); bPartnerLookup = new WSearchEditor ("C_BPartner_ID", false, false, true, lookup);
Timestamp date = null; Timestamp date = null;

View File

@ -48,6 +48,7 @@ import org.compiere.model.MColumn;
import org.compiere.model.MLookup; import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory; import org.compiere.model.MLookupFactory;
import org.compiere.model.MPayment; import org.compiere.model.MPayment;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
import org.compiere.util.Env; import org.compiere.util.Env;
@ -168,7 +169,7 @@ public class WCreateFromStatementUI extends CreateFromStatement implements Event
tenderTypeField = new WTableDirEditor (MPayment.COLUMNNAME_TenderType,false,false,true,lookup); tenderTypeField = new WTableDirEditor (MPayment.COLUMNNAME_TenderType,false,false,true,lookup);
tenderTypeField.getComponent().addEventListener(Events.ON_CHANGE, this); tenderTypeField.getComponent().addEventListener(Events.ON_CHANGE, this);
lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 3499, DisplayType.Search); lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, SystemIDs.COLUMN_C_INVOICE_C_BPARTNER_ID, DisplayType.Search);
bPartnerLookup = new WSearchEditor ("C_BPartner_ID", false, false, true, lookup); bPartnerLookup = new WSearchEditor ("C_BPartner_ID", false, false, true, lookup);
Timestamp date = Env.getContextAsDate(Env.getCtx(), p_WindowNo, MBankStatement.COLUMNNAME_StatementDate); Timestamp date = Env.getContextAsDate(Env.getCtx(), p_WindowNo, MBankStatement.COLUMNNAME_StatementDate);

View File

@ -36,6 +36,7 @@ import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory; import org.compiere.model.MLookupFactory;
import org.compiere.model.MOrder; import org.compiere.model.MOrder;
import org.compiere.model.MRMA; import org.compiere.model.MRMA;
import org.compiere.model.SystemIDs;
import org.compiere.process.DocAction; import org.compiere.process.DocAction;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
@ -163,7 +164,7 @@ public class WInOutGen extends InOutGen implements IFormController, EventListene
public void dynInit() throws Exception public void dynInit() throws Exception
{ {
// C_OrderLine.M_Warehouse_ID // C_OrderLine.M_Warehouse_ID
MLookup orgL = MLookupFactory.get (Env.getCtx(), form.getWindowNo(), 0, 11474 /* M_Requisition.M_Warehouse_ID */, DisplayType.TableDir); MLookup orgL = MLookupFactory.get (Env.getCtx(), form.getWindowNo(), 0, SystemIDs.COLUMN_M_REQUISITION_M_WAREHOUSE_ID, DisplayType.TableDir);
fWarehouse = new WTableDirEditor ("M_Warehouse_ID", true, false, true, orgL); fWarehouse = new WTableDirEditor ("M_Warehouse_ID", true, false, true, orgL);
lWarehouse.setText(Msg.translate(Env.getCtx(), "M_Warehouse_ID")); lWarehouse.setText(Msg.translate(Env.getCtx(), "M_Warehouse_ID"));
fWarehouse.addValueChangeListener(this); fWarehouse.addValueChangeListener(this);
@ -178,7 +179,7 @@ public class WInOutGen extends InOutGen implements IFormController, EventListene
docAction.setValue(DocAction.ACTION_Complete); docAction.setValue(DocAction.ACTION_Complete);
// docAction.addValueChangeListener(this); // IDEMPIERE-768 // docAction.addValueChangeListener(this); // IDEMPIERE-768
// C_Order.C_BPartner_ID // C_Order.C_BPartner_ID
MLookup bpL = MLookupFactory.get (Env.getCtx(), form.getWindowNo(), 0, 2762, DisplayType.Search); MLookup bpL = MLookupFactory.get (Env.getCtx(), form.getWindowNo(), 0, SystemIDs.COLUMN_C_ORDER_C_BPARTNER_ID, DisplayType.Search);
fBPartner = new WSearchEditor("C_BPartner_ID", false, false, true, bpL); fBPartner = new WSearchEditor("C_BPartner_ID", false, false, true, bpL);
lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID")); lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
fBPartner.addValueChangeListener(this); fBPartner.addValueChangeListener(this);

View File

@ -36,6 +36,7 @@ import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory; import org.compiere.model.MLookupFactory;
import org.compiere.model.MOrder; import org.compiere.model.MOrder;
import org.compiere.model.MRMA; import org.compiere.model.MRMA;
import org.compiere.model.SystemIDs;
import org.compiere.process.DocAction; import org.compiere.process.DocAction;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
@ -163,12 +164,12 @@ public class WInvoiceGen extends InvoiceGen implements IFormController, EventLis
*/ */
public void dynInit() throws Exception public void dynInit() throws Exception
{ {
MLookup orgL = MLookupFactory.get (Env.getCtx(), form.getWindowNo(), 0, 2163, DisplayType.TableDir); MLookup orgL = MLookupFactory.get (Env.getCtx(), form.getWindowNo(), 0, SystemIDs.COLUMN_C_ORDER_AD_ORG_ID, DisplayType.TableDir);
fOrg = new WTableDirEditor ("AD_Org_ID", false, false, true, orgL); fOrg = new WTableDirEditor ("AD_Org_ID", false, false, true, orgL);
// lOrg.setText(Msg.translate(Env.getCtx(), "AD_Org_ID")); // lOrg.setText(Msg.translate(Env.getCtx(), "AD_Org_ID"));
fOrg.addValueChangeListener(this); fOrg.addValueChangeListener(this);
// //
MLookup bpL = MLookupFactory.get (Env.getCtx(), form.getWindowNo(), 0, 2762, DisplayType.Search); MLookup bpL = MLookupFactory.get (Env.getCtx(), form.getWindowNo(), 0, SystemIDs.COLUMN_C_ORDER_C_BPARTNER_ID, DisplayType.Search);
fBPartner = new WSearchEditor ("C_BPartner_ID", false, false, true, bpL); fBPartner = new WSearchEditor ("C_BPartner_ID", false, false, true, bpL);
// lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID")); // lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
fBPartner.addValueChangeListener(this); fBPartner.addValueChangeListener(this);

View File

@ -50,6 +50,7 @@ import org.compiere.model.MQuery;
import org.compiere.model.MRefList; import org.compiere.model.MRefList;
import org.compiere.model.MSysConfig; import org.compiere.model.MSysConfig;
import org.compiere.model.Query; import org.compiere.model.Query;
import org.compiere.model.SystemIDs;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
import org.compiere.util.Env; import org.compiere.util.Env;
@ -152,7 +153,7 @@ public class WWFActivity extends ADForm implements EventListener<Event>
setTooltipText(bRefresh, "Refresh"); setTooltipText(bRefresh, "Refresh");
MLookup lookup = MLookupFactory.get(Env.getCtx(), m_WindowNo, MLookup lookup = MLookupFactory.get(Env.getCtx(), m_WindowNo,
0, 10443, DisplayType.Search); 0, SystemIDs.COLUMN_AD_WF_ACTIVITY_AD_USER_ID, DisplayType.Search);
fForward = new WSearchEditor(lookup, Msg.translate( fForward = new WSearchEditor(lookup, Msg.translate(
Env.getCtx(), "AD_User_ID"), "", true, false, true); Env.getCtx(), "AD_User_ID"), "", true, false, true);

View File

@ -167,7 +167,7 @@ public class EventWindow extends Window implements EventListener<Event> {
setVisible(false); setVisible(false);
else if (e.getTarget() == confirmPanel.getButton(ConfirmPanel.A_ZOOM)) { else if (e.getTarget() == confirmPanel.getButton(ConfirmPanel.A_ZOOM)) {
if (R_Request_ID > 0) if (R_Request_ID > 0)
AEnv.zoom(417, R_Request_ID); AEnv.zoom(MRequest.Table_ID, R_Request_ID);
} }
} }
} }