From 5bd3af0d2f8a7e3c2099c2085f862c3ae8358f1d Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 9 Aug 2022 16:12:54 +0200 Subject: [PATCH] IDEMPIERE-236 Centralization of hardcoded IDs (#1429) * IDEMPIERE-236 Centralization of hardcoded IDs * IDEMPIERE-236 Centralization of hardcoded IDs --- .../src/org/compiere/model/CalloutInvoice.java | 2 +- .../src/org/compiere/model/CalloutOrder.java | 2 +- .../src/org/compiere/process/RoleAccessUpdate.java | 2 +- .../adempiere/base/PackInFolderApplication.java | 3 ++- .../adempiere/base/PostMigrationApplication.java | 7 ++++--- .../src/org/compiere/impexp/ImpFormat.java | 13 ++++++++----- .../src/org/compiere/model/MSystem.java | 4 ++-- .../src/org/compiere/model/SystemIDs.java | 14 +++++--------- .../src/org/compiere/report/FinReport.java | 5 ++--- org.adempiere.base/src/org/compiere/util/DB.java | 5 +++-- .../src/org/compiere/util/Login.java | 2 +- .../org/compiere/server/ReplicationProcessor.java | 3 ++- .../server/org/compiere/server/AcctProcessor.java | 3 ++- .../org/compiere/server/AdempiereServer.java | 3 ++- .../main/server/org/compiere/server/Scheduler.java | 3 ++- .../webui/apps/form/WCreateFromDepositBatchUI.java | 3 ++- .../webui/apps/form/WCreateFromStatementUI.java | 3 ++- .../org/adempiere/webui/apps/form/WInOutGen.java | 5 +++-- .../org/adempiere/webui/apps/form/WInvoiceGen.java | 5 +++-- .../org/adempiere/webui/apps/wf/WWFActivity.java | 3 ++- .../org/adempiere/webui/dashboard/EventWindow.java | 2 +- 21 files changed, 51 insertions(+), 41 deletions(-) diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java index e468d45568..c3849ebab3 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java @@ -398,7 +398,7 @@ public class CalloutInvoice extends CalloutEngine } mTab.setValue("M_AttributeSetInstance_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"); String sql = "SELECT ChargeAmt FROM C_Charge WHERE C_Charge_ID=?"; diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java index 3c47048cc3..7b12a4a2bd 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java @@ -872,7 +872,7 @@ public class CalloutOrder extends CalloutEngine } mTab.setValue("M_AttributeSetInstance_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"); String sql = "SELECT ChargeAmt FROM C_Charge WHERE C_Charge_ID=?"; diff --git a/org.adempiere.base.process/src/org/compiere/process/RoleAccessUpdate.java b/org.adempiere.base.process/src/org/compiere/process/RoleAccessUpdate.java index 70146629e8..e0fbfc3bcc 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RoleAccessUpdate.java +++ b/org.adempiere.base.process/src/org/compiere/process/RoleAccessUpdate.java @@ -127,7 +127,7 @@ public class RoleAccessUpdate extends SvrProcess s_log.info("------------------"); ProcessInfo pi = new ProcessInfo("Role Access Update", 295); pi.setAD_Client_ID(0); - pi.setAD_User_ID(100); + pi.setAD_User_ID(SystemIDs.USER_SUPERUSER); RoleAccessUpdate rau = new RoleAccessUpdate(); rau.startProcess(Env.getCtx(), pi, null); diff --git a/org.adempiere.base/src/org/adempiere/base/PackInFolderApplication.java b/org.adempiere.base/src/org/adempiere/base/PackInFolderApplication.java index 90418fbc5a..f1633d9ce3 100644 --- a/org.adempiere.base/src/org/adempiere/base/PackInFolderApplication.java +++ b/org.adempiere.base/src/org/adempiere/base/PackInFolderApplication.java @@ -30,6 +30,7 @@ import java.util.logging.Level; import org.compiere.Adempiere; import org.compiere.model.MPInstance; +import org.compiere.model.SystemIDs; import org.compiere.process.ProcessCall; import org.compiere.process.ProcessInfo; import org.compiere.process.ProcessInfoUtil; @@ -71,7 +72,7 @@ public class PackInFolderApplication implements IApplication { String directory = commandlineArgs[0]; ProcessInfo pi = new ProcessInfo("PackInFolder", 200099); pi.setAD_Client_ID(0); - pi.setAD_User_ID(100); + pi.setAD_User_ID(SystemIDs.USER_SUPERUSER); MPInstance instance = new MPInstance(ctx, 200099, 0); instance.saveEx(); instance.createParameter(10, "Folder", directory); diff --git a/org.adempiere.base/src/org/adempiere/base/PostMigrationApplication.java b/org.adempiere.base/src/org/adempiere/base/PostMigrationApplication.java index bbd00dc2ca..236dadff44 100644 --- a/org.adempiere.base/src/org/adempiere/base/PostMigrationApplication.java +++ b/org.adempiere.base/src/org/adempiere/base/PostMigrationApplication.java @@ -17,6 +17,7 @@ import java.util.logging.Level; import org.adempiere.util.ProcessUtil; import org.compiere.Adempiere; +import org.compiere.model.SystemIDs; import org.compiere.process.ProcessInfo; import org.compiere.util.CLogMgt; import org.compiere.util.Env; @@ -46,7 +47,7 @@ public class PostMigrationApplication implements IApplication { private void checkSequence() { ProcessInfo pi = new ProcessInfo("Sequence Check", 258); pi.setAD_Client_ID(0); - pi.setAD_User_ID(100); + pi.setAD_User_ID(SystemIDs.USER_SUPERUSER); pi.setClassName("org.compiere.process.SequenceCheck"); ProcessUtil.startJavaProcess(Env.getCtx(), pi, null); } @@ -54,7 +55,7 @@ public class PostMigrationApplication implements IApplication { private void roleAccessUpdate() { ProcessInfo pi = new ProcessInfo("Role Access Update", 295); pi.setAD_Client_ID(0); - pi.setAD_User_ID(100); + pi.setAD_User_ID(SystemIDs.USER_SUPERUSER); pi.setClassName("org.compiere.process.RoleAccessUpdate"); ProcessUtil.startJavaProcess(Env.getCtx(), pi, null); } @@ -62,7 +63,7 @@ public class PostMigrationApplication implements IApplication { private void addMissingTranslation() { ProcessInfo pi = new ProcessInfo("Synchronize Terminology", 172); pi.setAD_Client_ID(0); - pi.setAD_User_ID(100); + pi.setAD_User_ID(SystemIDs.USER_SUPERUSER); pi.setClassName("org.compiere.process.SynchronizeTerminology"); ProcessUtil.startJavaProcess(Env.getCtx(), pi, null); } diff --git a/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java b/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java index 876796c880..54430c18c7 100644 --- a/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java +++ b/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java @@ -24,7 +24,10 @@ import java.util.Properties; import java.util.logging.Level; 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_I_GLJournal; import org.compiere.util.CLogger; @@ -152,24 +155,24 @@ public final class ImpFormat m_tableUniqueParent = ""; 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_tableUnique2 = "Value"; m_tableUniqueChild = "VendorProductNo"; // Vendor No may not be 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 // 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_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_tableUniqueChild = "Name"; // the key diff --git a/org.adempiere.base/src/org/compiere/model/MSystem.java b/org.adempiere.base/src/org/compiere/model/MSystem.java index 9026be2611..f09d535cac 100644 --- a/org.adempiere.base/src/org/compiere/model/MSystem.java +++ b/org.adempiere.base/src/org/compiere/model/MSystem.java @@ -377,8 +377,8 @@ public class MSystem extends X_AD_System + "FROM AD_User u" + " INNER JOIN AD_User_Roles ur ON (u.AD_User_ID=ur.AD_User_ID) " + "WHERE u.AD_Client_ID<>11" // no Demo - + " AND u.AD_User_ID NOT IN (0,10,100)"; // no System/SuperUser - int internalUsers = DB.getSQLValue(null, sql); + + " AND u.AD_User_ID NOT IN (?,?,?)"; // no System/SuperUser + int internalUsers = DB.getSQLValue(null, sql, SystemIDs.USER_SYSTEM_DEPRECATED, SystemIDs.USER_SYSTEM, SystemIDs.USER_SUPERUSER); setSupportUnits(internalUsers); } // setInternalUsers diff --git a/org.adempiere.base/src/org/compiere/model/SystemIDs.java b/org.adempiere.base/src/org/compiere/model/SystemIDs.java index 93c70848b6..783f45bd82 100644 --- a/org.adempiere.base/src/org/compiere/model/SystemIDs.java +++ b/org.adempiere.base/src/org/compiere/model/SystemIDs.java @@ -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_CURRENCY_ID = 3505; 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_PAYSELECTIONCHECK_C_PAYSELECTION_ID = 7670; 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_M_MOVEMENTLINE_M_ATTRIBUTESETINSTANCE_ID = 8551; 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_RESOURCEASSIGNMENT_S_RESOURCE_ID = 6826; 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_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_ORG_ID = 113; 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_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 USER_SUPERUSER = 100; diff --git a/org.adempiere.base/src/org/compiere/report/FinReport.java b/org.adempiere.base/src/org/compiere/report/FinReport.java index d39b6e64b6..ce114718e1 100644 --- a/org.adempiere.base/src/org/compiere/report/FinReport.java +++ b/org.adempiere.base/src/org/compiere/report/FinReport.java @@ -16,8 +16,6 @@ *****************************************************************************/ package org.compiere.report; -import static org.compiere.model.SystemIDs.TABLE_T_REPORT; - import java.math.BigDecimal; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -27,6 +25,7 @@ import java.util.List; import java.util.logging.Level; import org.compiere.model.I_C_ValidCombination; +import org.compiere.model.I_T_Report; import org.compiere.model.MAcctSchemaElement; import org.compiere.model.MPeriod; import org.compiere.model.MReportCube; @@ -1809,7 +1808,7 @@ public class FinReport extends SvrProcess // Create New 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); AD_PrintFormat_ID = pf.getAD_PrintFormat_ID(); m_report.setAD_PrintFormat_ID(AD_PrintFormat_ID); diff --git a/org.adempiere.base/src/org/compiere/util/DB.java b/org.adempiere.base/src/org/compiere/util/DB.java index 20837117aa..6f206b585a 100644 --- a/org.adempiere.base/src/org/compiere/util/DB.java +++ b/org.adempiere.base/src/org/compiere/util/DB.java @@ -57,6 +57,7 @@ import org.compiere.model.MSystem; import org.compiere.model.MTable; import org.compiere.model.PO; import org.compiere.model.POResultSet; +import org.compiere.model.SystemIDs; import org.compiere.process.ProcessInfo; import org.compiere.process.ProcessInfoParameter; @@ -239,8 +240,8 @@ public final class DB .append(" EMail=").append(DB.TO_STRING(adminEMail)) .append(", EMailUser=").append(DB.TO_STRING(mailUser)) .append(", EMailUserPW=").append(DB.TO_STRING(mailPassword)) - .append(" WHERE AD_User_ID IN (0,100)"); - no = DB.executeUpdate(sql.toString(), null); + .append(" WHERE AD_User_ID IN (?,?,?)"); + 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); // try (FileOutputStream out = new FileOutputStream(envFile)) diff --git a/org.adempiere.base/src/org/compiere/util/Login.java b/org.adempiere.base/src/org/compiere/util/Login.java index be271c773e..a42fa0619d 100644 --- a/org.adempiere.base/src/org/compiere/util/Login.java +++ b/org.adempiere.base/src/org/compiere/util/Login.java @@ -376,7 +376,7 @@ public class Login if (force) { 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, Env.USER_LEVEL, "S "); // Format 'SCO' Env.setContext(m_ctx, "#User_Client", "0"); // Format c1, c2, ... diff --git a/org.adempiere.replication.server/src/org/compiere/server/ReplicationProcessor.java b/org.adempiere.replication.server/src/org/compiere/server/ReplicationProcessor.java index 0f06cec540..d67e3ad241 100644 --- a/org.adempiere.replication.server/src/org/compiere/server/ReplicationProcessor.java +++ b/org.adempiere.replication.server/src/org/compiere/server/ReplicationProcessor.java @@ -35,6 +35,7 @@ import org.adempiere.server.rpl.IImportProcessor; import org.compiere.model.AdempiereProcessor; import org.compiere.model.MClient; import org.compiere.model.MOrgInfo; +import org.compiere.model.SystemIDs; import org.compiere.model.X_IMP_Processor_Type; import org.compiere.util.Env; import org.compiere.util.TimeUtil; @@ -166,7 +167,7 @@ public class ReplicationProcessor extends AdempiereServer { else if (mImportProcessor.getUpdatedBy() > 0) AD_User_ID = mImportProcessor.getUpdatedBy(); else - AD_User_ID = 100; //fall back to SuperUser + AD_User_ID = SystemIDs.USER_SUPERUSER; //fall back to SuperUser return AD_User_ID; } diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AcctProcessor.java b/org.adempiere.server/src/main/server/org/compiere/server/AcctProcessor.java index 361aa8cfb4..1ccac22b68 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AcctProcessor.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AcctProcessor.java @@ -36,6 +36,7 @@ import org.compiere.model.MOrgInfo; import org.compiere.model.MRole; import org.compiere.model.MTable; import org.compiere.model.MUser; +import org.compiere.model.SystemIDs; import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.TimeUtil; @@ -122,7 +123,7 @@ public class AcctProcessor extends AdempiereServer else if (m_model.getUpdatedBy() > 0) AD_User_ID = m_model.getUpdatedBy(); else - AD_User_ID = 100; //fall back to SuperUser + AD_User_ID = SystemIDs.USER_SUPERUSER; //fall back to SuperUser return AD_User_ID; } diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java index 8bdaff0a62..327829fa19 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java @@ -34,6 +34,7 @@ import org.compiere.model.MSystem; import org.compiere.model.MUser; import org.compiere.model.PO; import org.compiere.model.Query; +import org.compiere.model.SystemIDs; import org.compiere.util.CLogger; import org.compiere.util.Env; import org.compiere.util.TimeUtil; @@ -202,7 +203,7 @@ public abstract class AdempiereServer implements Runnable else if (po.get_ValueAsInt("UpdatedBy") > 0) AD_User_ID = po.get_ValueAsInt("UpdatedBy"); else - AD_User_ID = 100; //fall back to SuperUser + AD_User_ID = SystemIDs.USER_SUPERUSER; //fall back to SuperUser return AD_User_ID; } diff --git a/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java b/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java index 05470c5335..338cc4a3af 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java @@ -54,6 +54,7 @@ import org.compiere.model.MSchedulerRecipient; import org.compiere.model.MSession; import org.compiere.model.MUser; import org.compiere.model.PO; +import org.compiere.model.SystemIDs; import org.compiere.print.MPrintFormat; import org.compiere.process.ProcessInfo; import org.compiere.process.ProcessInfoUtil; @@ -504,7 +505,7 @@ public class Scheduler extends AdempiereServer else if (scheduler.getUpdatedBy() > 0) AD_User_ID = scheduler.getUpdatedBy(); else - AD_User_ID = 100; //fall back to SuperUser + AD_User_ID = SystemIDs.USER_SUPERUSER; //fall back to SuperUser return AD_User_ID; } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromDepositBatchUI.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromDepositBatchUI.java index dca7727cc3..caad9ffa40 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromDepositBatchUI.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromDepositBatchUI.java @@ -47,6 +47,7 @@ import org.compiere.model.MDepositBatch; import org.compiere.model.MLookup; import org.compiere.model.MLookupFactory; import org.compiere.model.MPayment; +import org.compiere.model.SystemIDs; import org.compiere.util.CLogger; import org.compiere.util.DisplayType; 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); 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); Timestamp date = null; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromStatementUI.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromStatementUI.java index a13ab582aa..9e7cf276e8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromStatementUI.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromStatementUI.java @@ -48,6 +48,7 @@ import org.compiere.model.MColumn; import org.compiere.model.MLookup; import org.compiere.model.MLookupFactory; import org.compiere.model.MPayment; +import org.compiere.model.SystemIDs; import org.compiere.util.CLogger; import org.compiere.util.DisplayType; 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.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); Timestamp date = Env.getContextAsDate(Env.getCtx(), p_WindowNo, MBankStatement.COLUMNNAME_StatementDate); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java index e98e255578..3e3a14744d 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java @@ -36,6 +36,7 @@ import org.compiere.model.MLookup; import org.compiere.model.MLookupFactory; import org.compiere.model.MOrder; import org.compiere.model.MRMA; +import org.compiere.model.SystemIDs; import org.compiere.process.DocAction; import org.compiere.util.CLogger; import org.compiere.util.DisplayType; @@ -163,7 +164,7 @@ public class WInOutGen extends InOutGen implements IFormController, EventListene public void dynInit() throws Exception { // 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); lWarehouse.setText(Msg.translate(Env.getCtx(), "M_Warehouse_ID")); fWarehouse.addValueChangeListener(this); @@ -178,7 +179,7 @@ public class WInOutGen extends InOutGen implements IFormController, EventListene docAction.setValue(DocAction.ACTION_Complete); // docAction.addValueChangeListener(this); // IDEMPIERE-768 // 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); lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID")); fBPartner.addValueChangeListener(this); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInvoiceGen.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInvoiceGen.java index 716e4c3857..27691a0bd0 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInvoiceGen.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInvoiceGen.java @@ -36,6 +36,7 @@ import org.compiere.model.MLookup; import org.compiere.model.MLookupFactory; import org.compiere.model.MOrder; import org.compiere.model.MRMA; +import org.compiere.model.SystemIDs; import org.compiere.process.DocAction; import org.compiere.util.CLogger; import org.compiere.util.DisplayType; @@ -163,12 +164,12 @@ public class WInvoiceGen extends InvoiceGen implements IFormController, EventLis */ 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); // lOrg.setText(Msg.translate(Env.getCtx(), "AD_Org_ID")); 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); // lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID")); fBPartner.addValueChangeListener(this); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WWFActivity.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WWFActivity.java index 8efd005862..9c01cbaabb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WWFActivity.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WWFActivity.java @@ -50,6 +50,7 @@ import org.compiere.model.MQuery; import org.compiere.model.MRefList; import org.compiere.model.MSysConfig; import org.compiere.model.Query; +import org.compiere.model.SystemIDs; import org.compiere.util.CLogger; import org.compiere.util.DisplayType; import org.compiere.util.Env; @@ -152,7 +153,7 @@ public class WWFActivity extends ADForm implements EventListener setTooltipText(bRefresh, "Refresh"); 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( Env.getCtx(), "AD_User_ID"), "", true, false, true); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/EventWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/EventWindow.java index 3f874153cf..c4b38771b5 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/EventWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/EventWindow.java @@ -167,7 +167,7 @@ public class EventWindow extends Window implements EventListener { setVisible(false); else if (e.getTarget() == confirmPanel.getButton(ConfirmPanel.A_ZOOM)) { if (R_Request_ID > 0) - AEnv.zoom(417, R_Request_ID); + AEnv.zoom(MRequest.Table_ID, R_Request_ID); } } }