From 60c4dc7306b3419c48863afa8275b79d1fe4f4e4 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 20 Oct 2017 11:48:39 +0200 Subject: [PATCH 01/14] IDEMPIERE-3115 - solve deprecation warning --- .../WEB-INF/src/org/adempiere/webui/info/InfoWindow.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java index 21d14192a8..6dacc83d87 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java @@ -2055,7 +2055,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL // eval only mandatory field if (validateGrid.isMandatory(true)){ // update color of field - wEditor.updateLabelStyle(); + wEditor.updateStyle(); Object data = wEditor.getValue(); if (data == null || data.toString().length() == 0) { return false; From f8cf23f2cb73c53a65bd6bda24dc5900505e9110 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 20 Oct 2017 19:41:57 +0200 Subject: [PATCH 02/14] IDEMPIERE-3521 InfoWindow problem on other SQL when make a register count / peer review and integrate patch from Orlando --- .../oracle/201710201214_IDEMPIERE-3521.sql | 15 +++++++ .../201710201214_IDEMPIERE-3521.sql | 12 +++++ .../src/org/compiere/model/MInfoWindow.java | 3 +- .../org/adempiere/webui/info/InfoWindow.java | 45 +++++++++++-------- .../org/adempiere/webui/panel/InfoPanel.java | 4 -- 5 files changed, 56 insertions(+), 23 deletions(-) create mode 100644 migration/i4.1/oracle/201710201214_IDEMPIERE-3521.sql create mode 100644 migration/i4.1/postgresql/201710201214_IDEMPIERE-3521.sql diff --git a/migration/i4.1/oracle/201710201214_IDEMPIERE-3521.sql b/migration/i4.1/oracle/201710201214_IDEMPIERE-3521.sql new file mode 100644 index 0000000000..11fdf2e7b0 --- /dev/null +++ b/migration/i4.1/oracle/201710201214_IDEMPIERE-3521.sql @@ -0,0 +1,15 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-3521 InfoWindow problem on other SQL when make a register count +-- Oct 20, 2017 12:13:41 PM CEST +UPDATE AD_Field SET SeqNo=130, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-20 12:13:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201634 +; + +-- Oct 20, 2017 12:13:43 PM CEST +UPDATE AD_Field SET SeqNo=120, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2017-10-20 12:13:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13579 +; + +SELECT register_migration_script('201710201214_IDEMPIERE-3521.sql') FROM dual +; + diff --git a/migration/i4.1/postgresql/201710201214_IDEMPIERE-3521.sql b/migration/i4.1/postgresql/201710201214_IDEMPIERE-3521.sql new file mode 100644 index 0000000000..fd659b051f --- /dev/null +++ b/migration/i4.1/postgresql/201710201214_IDEMPIERE-3521.sql @@ -0,0 +1,12 @@ +-- IDEMPIERE-3521 InfoWindow problem on other SQL when make a register count +-- Oct 20, 2017 12:13:41 PM CEST +UPDATE AD_Field SET SeqNo=130, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-20 12:13:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201634 +; + +-- Oct 20, 2017 12:13:43 PM CEST +UPDATE AD_Field SET SeqNo=120, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2017-10-20 12:13:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13579 +; + +SELECT register_migration_script('201710201214_IDEMPIERE-3521.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/MInfoWindow.java b/org.adempiere.base/src/org/compiere/model/MInfoWindow.java index f3436c14f4..04b00c79e3 100644 --- a/org.adempiere.base/src/org/compiere/model/MInfoWindow.java +++ b/org.adempiere.base/src/org/compiere/model/MInfoWindow.java @@ -24,6 +24,7 @@ import java.util.List; import java.util.Properties; import java.util.logging.Level; +import org.adempiere.exceptions.AdempiereException; import org.adempiere.model.MInfoProcess; import org.adempiere.model.MInfoRelated; import org.compiere.model.AccessSqlParser.TableInfo; @@ -446,7 +447,7 @@ public class MInfoWindow extends X_AD_InfoWindow pstmt.executeQuery(); }catch (Exception ex){ log.log(Level.WARNING, ex.getMessage()); - return; + throw new AdempiereException(ex); } finally { DB.close(pstmt); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java index 6dacc83d87..4b050e6f60 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java @@ -106,11 +106,11 @@ import org.zkoss.zul.Vbox; * @contributor xolali IDEMPIERE-1045 Sub-Info Tabs (reviewed by red1) */ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventListener { - /** * */ - private static final long serialVersionUID = 8358292103127594383L; + private static final long serialVersionUID = 1672005382454423850L; + protected Grid parameterGrid; private Borderlayout layout; private Vbox southBody; @@ -1474,16 +1474,8 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL dataSql = MRole.getDefault().addAccessSQL(dataSql, getTableName(), MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); - if (infoWindow.getOtherClause() != null && infoWindow.getOtherClause().trim().length() > 0) { - String otherClause = infoWindow.getOtherClause(); - if (otherClause.indexOf("@") >= 0) { - String s = Env.parseContext(infoContext, p_WindowNo, otherClause, true, false); - if (s.length() == 0) { - log.severe("Failed to parse other clause. " + otherClause); - } else { - otherClause = s; - } - } + String otherClause = getOtherClauseParsed(); + if (otherClause.length() > 0) { dataSql = dataSql + " " + otherClause; } @@ -1498,8 +1490,24 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL } return dataSql; } - - @Override + + private String getOtherClauseParsed() { + String otherClause = ""; + if (infoWindow != null && infoWindow.getOtherClause() != null && infoWindow.getOtherClause().trim().length() > 0) { + otherClause = infoWindow.getOtherClause(); + if (otherClause.indexOf("@") >= 0) { + String s = Env.parseContext(infoContext, p_WindowNo, otherClause, true, false); + if (s.length() == 0) { + log.severe("Failed to parse other clause. " + otherClause); + } else { + otherClause = s; + } + } + } + return otherClause; + } + + @Override protected void executeQuery() { prepareTable(); super.executeQuery(); @@ -1705,10 +1713,11 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL } countSql = MRole.getDefault().addAccessSQL (countSql, getTableName(), MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); - // Fix GroupBy On InfoWindow - String otherClause = infoWindow.getOtherClause(); - if (otherClause !=null) - countSql = countSql+" "+otherClause; + // IDEMPIERE-3521 + String otherClause = getOtherClauseParsed(); + if (otherClause.length() > 0) { + countSql = countSql + " " + otherClause; + } countSql = "SELECT COUNT(*) FROM ( " + countSql + " ) a"; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java index 376011e0d4..6ceedc67f7 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java @@ -1065,10 +1065,6 @@ public abstract class InfoPanel extends Window implements EventListener, countSql = countSql.trim(); countSql = countSql.substring(0, countSql.length() - 5); } - String otherClause = infoWindow.getOtherClause(); // Fix otherClause on count - if (otherClause != null) - countSql = countSql+" "+otherClause; - countSql = MRole.getDefault().addAccessSQL (countSql, getTableName(), MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); if (log.isLoggable(Level.FINER)) From 7e8d895f4b23d5522a910c7d85caa9fb6c9b6d00 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 23 Oct 2017 18:45:01 +0200 Subject: [PATCH 03/14] IDEMPIERE-3338 Document Status Indicator / fix wrong example on GW --- migration/i4.1/oracle/201710231841_IDEMPIERE-3338.sql | 11 +++++++++++ .../i4.1/postgresql/201710231841_IDEMPIERE-3338.sql | 8 ++++++++ 2 files changed, 19 insertions(+) create mode 100644 migration/i4.1/oracle/201710231841_IDEMPIERE-3338.sql create mode 100644 migration/i4.1/postgresql/201710231841_IDEMPIERE-3338.sql diff --git a/migration/i4.1/oracle/201710231841_IDEMPIERE-3338.sql b/migration/i4.1/oracle/201710231841_IDEMPIERE-3338.sql new file mode 100644 index 0000000000..9747e4e7a4 --- /dev/null +++ b/migration/i4.1/oracle/201710231841_IDEMPIERE-3338.sql @@ -0,0 +1,11 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-3338 Document Status Indicator / fix wrong example on GW +-- Oct 23, 2017 6:41:13 PM CEST +UPDATE PA_DocumentStatus SET WhereClause='M_InOut.IsSOTrx=''Y'' AND M_InOut.Processed=''N'' AND M_InOut.MovementType IN (''C-'')',Updated=TO_DATE('2017-10-23 18:41:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DocumentStatus_ID=200001 +; + +SELECT register_migration_script('201710231841_IDEMPIERE-3338.sql') FROM dual +; + diff --git a/migration/i4.1/postgresql/201710231841_IDEMPIERE-3338.sql b/migration/i4.1/postgresql/201710231841_IDEMPIERE-3338.sql new file mode 100644 index 0000000000..948a8ca2c9 --- /dev/null +++ b/migration/i4.1/postgresql/201710231841_IDEMPIERE-3338.sql @@ -0,0 +1,8 @@ +-- IDEMPIERE-3338 Document Status Indicator / fix wrong example on GW +-- Oct 23, 2017 6:41:13 PM CEST +UPDATE PA_DocumentStatus SET WhereClause='M_InOut.IsSOTrx=''Y'' AND M_InOut.Processed=''N'' AND M_InOut.MovementType IN (''C-'')',Updated=TO_TIMESTAMP('2017-10-23 18:41:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DocumentStatus_ID=200001 +; + +SELECT register_migration_script('201710231841_IDEMPIERE-3338.sql') FROM dual +; + From 790cd64ed2033b1faaf3ecb473a18ef97c6e4e06 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 23 Oct 2017 19:15:58 +0200 Subject: [PATCH 04/14] IDEMPIERE-3173 Columns that must not be copied --- .../i4.1/oracle/201710231915_IDEMPIERE-3173.sql | 15 +++++++++++++++ .../postgresql/201710231915_IDEMPIERE-3173.sql | 12 ++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 migration/i4.1/oracle/201710231915_IDEMPIERE-3173.sql create mode 100644 migration/i4.1/postgresql/201710231915_IDEMPIERE-3173.sql diff --git a/migration/i4.1/oracle/201710231915_IDEMPIERE-3173.sql b/migration/i4.1/oracle/201710231915_IDEMPIERE-3173.sql new file mode 100644 index 0000000000..41f7478049 --- /dev/null +++ b/migration/i4.1/oracle/201710231915_IDEMPIERE-3173.sql @@ -0,0 +1,15 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-3173 Columns that must not be copied +-- Oct 23, 2017 7:14:50 PM CEST +UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2017-10-23 19:14:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200558 +; + +-- Oct 23, 2017 7:15:09 PM CEST +UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2017-10-23 19:15:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200704 +; + +SELECT register_migration_script('201710231915_IDEMPIERE-3173.sql') FROM dual +; + diff --git a/migration/i4.1/postgresql/201710231915_IDEMPIERE-3173.sql b/migration/i4.1/postgresql/201710231915_IDEMPIERE-3173.sql new file mode 100644 index 0000000000..598365af06 --- /dev/null +++ b/migration/i4.1/postgresql/201710231915_IDEMPIERE-3173.sql @@ -0,0 +1,12 @@ +-- IDEMPIERE-3173 Columns that must not be copied +-- Oct 23, 2017 7:14:50 PM CEST +UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2017-10-23 19:14:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200558 +; + +-- Oct 23, 2017 7:15:09 PM CEST +UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2017-10-23 19:15:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200704 +; + +SELECT register_migration_script('201710231915_IDEMPIERE-3173.sql') FROM dual +; + From 96f2838b062a350a66b9798f916139d92e68b3cf Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 24 Oct 2017 16:39:45 +0200 Subject: [PATCH 05/14] IDEMPIERE-1162 --- org.adempiere.base/src/org/compiere/util/Env.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/util/Env.java b/org.adempiere.base/src/org/compiere/util/Env.java index c8eaa091f9..93c3886060 100644 --- a/org.adempiere.base/src/org/compiere/util/Env.java +++ b/org.adempiere.base/src/org/compiere/util/Env.java @@ -1663,6 +1663,9 @@ public final class Env outStr.append(mf.format(v)); } } else { + if (colToken != null && colToken.isSecure()) { + v = "********"; + } outStr.append(v.toString()); } } From a7ce6b29ac484999d4c41c9ac5d48413ab83b9ab Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 24 Oct 2017 16:52:47 +0200 Subject: [PATCH 06/14] IDEMPIERE-3096 Use indirect context for mail signatures --- org.adempiere.base/src/org/compiere/model/MMailText.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/model/MMailText.java b/org.adempiere.base/src/org/compiere/model/MMailText.java index ada28c96c6..f9d11e730b 100644 --- a/org.adempiere.base/src/org/compiere/model/MMailText.java +++ b/org.adempiere.base/src/org/compiere/model/MMailText.java @@ -216,6 +216,10 @@ public class MMailText extends X_R_MailText */ private String parseVariable (String variable, PO po) { + if (variable.contains("<") && variable.contains(">")) { // IDEMPIERE-3096 + return Env.parseVariable("@"+variable+"@", po, get_TrxName(), true); + } + // special default formatting cases for dates/times/boolean in mail text not covered by Env.parseVariable int index = po.get_ColumnIndex(variable); if (index == -1){ StringBuilder msgreturn = new StringBuilder("@").append(variable).append("@"); From 73f1764acdcf930ce8b7e2568c1d529a6a631bc7 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Tue, 24 Oct 2017 17:13:39 +0200 Subject: [PATCH 07/14] IDEMPIERE-3411 When lauching a report based on a report view, available print formats are not filtered --- .../i4.1/oracle/201707041543_IDEMPIERE-3411.sql | 10 ++++++++++ .../postgresql/201707041543_IDEMPIERE-3411.sql | 7 +++++++ .../src/org/compiere/model/MSysConfig.java | 3 ++- .../webui/apps/AbstractProcessDialog.java | 15 +++++++++++---- 4 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 migration/i4.1/oracle/201707041543_IDEMPIERE-3411.sql create mode 100644 migration/i4.1/postgresql/201707041543_IDEMPIERE-3411.sql diff --git a/migration/i4.1/oracle/201707041543_IDEMPIERE-3411.sql b/migration/i4.1/oracle/201707041543_IDEMPIERE-3411.sql new file mode 100644 index 0000000000..6413c24481 --- /dev/null +++ b/migration/i4.1/oracle/201707041543_IDEMPIERE-3411.sql @@ -0,0 +1,10 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-3411 : When lauching a report based on a report view, available print formats are not filtered +-- Jul 4, 2017 3:42:50 PM CEST +INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200104,0,0,TO_DATE('2017-07-04 15:42:49','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2017-07-04 15:42:49','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','ZK_REPORT_ONLY_PRINTFORMAT_LINKEDTO_REPORTVIEW','N','If set to Yes, print formats will be filtered according to the current report view','U','C','18e6758b-db72-480e-b832-72080c8f2268') +; + +SELECT register_migration_script('201707041543_IDEMPIERE-3411.sql') FROM dual +; \ No newline at end of file diff --git a/migration/i4.1/postgresql/201707041543_IDEMPIERE-3411.sql b/migration/i4.1/postgresql/201707041543_IDEMPIERE-3411.sql new file mode 100644 index 0000000000..6328842b6e --- /dev/null +++ b/migration/i4.1/postgresql/201707041543_IDEMPIERE-3411.sql @@ -0,0 +1,7 @@ +-- IDEMPIERE-3411 : When lauching a report based on a report view, available print formats are not filtered +-- Jul 4, 2017 3:42:50 PM CEST +INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200104,0,0,TO_TIMESTAMP('2017-07-04 15:42:49','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2017-07-04 15:42:49','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','ZK_REPORT_ONLY_PRINTFORMAT_LINKEDTO_REPORTVIEW','N','If set to Yes, print formats will be filtered according to the current report view','U','C','18e6758b-db72-480e-b832-72080c8f2268') +; + +SELECT register_migration_script('201707041543_IDEMPIERE-3411.sql') FROM dual +; \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/model/MSysConfig.java b/org.adempiere.base/src/org/compiere/model/MSysConfig.java index 8b9ebda7cc..da1c198cfb 100644 --- a/org.adempiere.base/src/org/compiere/model/MSysConfig.java +++ b/org.adempiere.base/src/org/compiere/model/MSysConfig.java @@ -42,7 +42,7 @@ public class MSysConfig extends X_AD_SysConfig /** * */ - private static final long serialVersionUID = -1378971388226313818L; + private static final long serialVersionUID = -7805174199114873428L; public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION"; public static final String ALERT_SEND_ATTACHMENT_AS_XLS = "ALERT_SEND_ATTACHMENT_AS_XLS"; @@ -168,6 +168,7 @@ public class MSysConfig extends X_AD_SysConfig public static final String ZK_PAGING_SIZE = "ZK_PAGING_SIZE"; public static final String ZK_REPORT_FORM_OUTPUT_TYPE = "ZK_REPORT_FORM_OUTPUT_TYPE"; public static final String ZK_REPORT_JASPER_OUTPUT_TYPE = "ZK_REPORT_JASPER_OUTPUT_TYPE"; + public static final String ZK_REPORT_ONLY_PRINTFORMAT_LINKEDTO_REPORTVIEW = "ZK_REPORT_ONLY_PRINTFORMAT_LINKEDTO_REPORTVIEW"; public static final String ZK_REPORT_TABLE_OUTPUT_TYPE = "ZK_REPORT_TABLE_OUTPUT_TYPE"; public static final String ZK_ROOT_FOLDER_BROWSER = "ZK_ROOT_FOLDER_BROWSER"; public static final String ZK_SEQ_DEFAULT_VALUE_PANEL = "ZK_SEQ_DEFAULT_VALUE_PANEL"; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AbstractProcessDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AbstractProcessDialog.java index 99dea34eb2..2537c89b17 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AbstractProcessDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AbstractProcessDialog.java @@ -103,7 +103,7 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI /** * */ - private static final long serialVersionUID = -4807787318205732697L; + private static final long serialVersionUID = 8307953279095577359L; private static final String ON_COMPLETE = "onComplete"; private static final String ON_STATUS_UPDATE = "onStatusUpdate"; @@ -510,16 +510,23 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI MPrintFormat format = new MPrintFormat(m_ctx, pr.getAD_PrintFormat_ID(), null); table_ID = format.getAD_Table_ID(); } - String valCode = null; + StringBuilder valCode = new StringBuilder(); if (table_ID > 0) { - valCode = "AD_PrintFormat.AD_Table_ID=" + table_ID; + valCode.append("AD_PrintFormat.AD_Table_ID=").append(table_ID); m_isCanExport = MRole.getDefault().isCanExport(table_ID); } + + if (pr.getAD_ReportView_ID() > 0 && MSysConfig.getBooleanValue(MSysConfig.ZK_REPORT_ONLY_PRINTFORMAT_LINKEDTO_REPORTVIEW, false, client.getAD_Client_ID())) { + if (valCode.length() > 0) + valCode.append(" AND "); + valCode.append("AD_PrintFormat.AD_ReportView_ID=").append(pr.getAD_ReportView_ID()); + } + Lookup lookup = MLookupFactory.get (Env.getCtx(), m_WindowNo, AD_Column_ID, DisplayType.TableDir, Env.getLanguage(Env.getCtx()), "AD_PrintFormat_ID", 0, false, - valCode); + valCode.toString()); fPrintFormat = new WTableDirEditor("AD_PrintFormat_ID", false, false, true, lookup); From 4008e599862bc6849b1bd4387736ff633e504b9d Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 24 Oct 2017 18:16:29 +0200 Subject: [PATCH 08/14] IDEMPIERE-3451 - after change from 72f4c205ac50 - the db port and db name are not correctly read from the actual properties configured --- .../src/org/compiere/install/ConfigurationData.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/org.adempiere.install/src/org/compiere/install/ConfigurationData.java b/org.adempiere.install/src/org/compiere/install/ConfigurationData.java index f5b3c9aea2..1d862e2312 100644 --- a/org.adempiere.install/src/org/compiere/install/ConfigurationData.java +++ b/org.adempiere.install/src/org/compiere/install/ConfigurationData.java @@ -320,7 +320,7 @@ public class ConfigurationData initAppsServer(); setAppsServer(hostName); // Database Server - initDatabase(""); + initDatabase(Database.DB_POSTGRESQL); String connectionName = getDatabaseDiscovered(); if (connectionName != null && connectionName.trim().length() > 0) { setDatabaseName(resolveDatabaseName(connectionName)); @@ -1169,7 +1169,10 @@ public class ConfigurationData } else { - m_databaseConfig[index].init(this); + if ( ! p_properties.containsKey(ADEMPIERE_DB_NAME) + && ! p_properties.containsKey(ADEMPIERE_DB_PORT)) { + m_databaseConfig[index].init(this); + } if (p_panel != null) { From 1237e22db71caaf34539bb5d211c1a1ebc79b5f6 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 24 Oct 2017 20:46:26 +0200 Subject: [PATCH 09/14] IDEMPIERE-2334 (Allow zoom from URL) colliding with IDEMPIERE-3000 (Automatic opening of menu entries at login) - automatic opening must not happen when the URL is an Action URL --- .../webui/desktop/DefaultDesktop.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java index 98fe8529b7..2559ee5c0e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java @@ -24,6 +24,8 @@ import java.math.BigDecimal; import java.util.List; import java.util.Map; import java.util.Properties; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import org.adempiere.base.event.EventManager; import org.adempiere.base.event.IEventManager; @@ -925,6 +927,8 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria return AD_Tree_ID; } private void automaticOpen(Properties ctx) { + if (isActionURL()) // IDEMPIERE-2334 vs IDEMPIERE-3000 - do not open windows when coming from an action URL + return; StringBuilder sql = new StringBuilder("SELECT m.Action, COALESCE(m.AD_Window_ID, m.AD_Process_ID, m.AD_Form_ID, m.AD_Workflow_ID, m.AD_Task_ID, AD_InfoWindow_ID) ") .append(" FROM AD_TreeBar tb") @@ -973,5 +977,17 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria } } } - } + } + + private boolean isActionURL() { + ConcurrentMap parameters = new ConcurrentHashMap(Executions.getCurrent().getParameterMap()); + String action = ""; + if (parameters != null) { + String[] strs = parameters.get("Action"); + if (strs != null && strs.length == 1 && strs[0] != null) + action = strs[0]; + } + return ! Util.isEmpty(action); + } + } From dae313ae781306fbdaad2ea39be1f3aa88fd54aa Mon Sep 17 00:00:00 2001 From: Diego Ruiz Date: Wed, 25 Oct 2017 12:46:16 +0200 Subject: [PATCH 10/14] IDEMPIERE-3529 - Add parameters to InvoicePrint process --- .../oracle/201710251241_IDEMPIERE-3529.sql | 14 ++++++++++++++ .../postgresql/201710251241_IDEMPIERE-3529.sql | 11 +++++++++++ .../adempiere/webui/process/InvoicePrint.java | 18 +++++++++++++++++- 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 migration/i4.1/oracle/201710251241_IDEMPIERE-3529.sql create mode 100644 migration/i4.1/postgresql/201710251241_IDEMPIERE-3529.sql diff --git a/migration/i4.1/oracle/201710251241_IDEMPIERE-3529.sql b/migration/i4.1/oracle/201710251241_IDEMPIERE-3529.sql new file mode 100644 index 0000000000..e2d6ee3dad --- /dev/null +++ b/migration/i4.1/oracle/201710251241_IDEMPIERE-3529.sql @@ -0,0 +1,14 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-3529 - Add parameters to InvoicePrint process +-- Oct 25, 2017 12:09:30 PM CEST +INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,AD_Val_Rule_ID,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200219,0,0,'Y',TO_DATE('2017-10-25 12:09:30','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2017-10-25 12:09:30','YYYY-MM-DD HH24:MI:SS'),100,'Document Type','Document type or rules','The Document Type determines document sequence and processing rules',200,60,19,170,'N',200097,0,'N','C_DocType_ID','Y','D',196,'554013bb-d6c0-4795-a9c6-aa2cb6dfc2bf','N') +; + +-- Oct 25, 2017 12:16:28 PM CEST +INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200220,0,0,'Y',TO_DATE('2017-10-25 12:16:28','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2017-10-25 12:16:28','YYYY-MM-DD HH24:MI:SS'),100,'Paid','The document is paid',200,70,17,319,'N',0,'N','IsPaid','Y','D',1402,'7d2f7567-fb4f-44b0-a098-ddaa81ca7a4f','N') +; + +SELECT register_migration_script('201710251241_IDEMPIERE-3529.sql') FROM dual +; diff --git a/migration/i4.1/postgresql/201710251241_IDEMPIERE-3529.sql b/migration/i4.1/postgresql/201710251241_IDEMPIERE-3529.sql new file mode 100644 index 0000000000..7eba976b0d --- /dev/null +++ b/migration/i4.1/postgresql/201710251241_IDEMPIERE-3529.sql @@ -0,0 +1,11 @@ +-- IDEMPIERE-3529 - Add parameters to InvoicePrint process +-- Oct 25, 2017 12:09:30 PM CEST +INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,AD_Val_Rule_ID,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200219,0,0,'Y',TO_TIMESTAMP('2017-10-25 12:09:30','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-10-25 12:09:30','YYYY-MM-DD HH24:MI:SS'),100,'Document Type','Document type or rules','The Document Type determines document sequence and processing rules',200,60,19,170,'N',200097,0,'N','C_DocType_ID','Y','D',196,'554013bb-d6c0-4795-a9c6-aa2cb6dfc2bf','N') +; + +-- Oct 25, 2017 12:16:28 PM CEST +INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200220,0,0,'Y',TO_TIMESTAMP('2017-10-25 12:16:28','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-10-25 12:16:28','YYYY-MM-DD HH24:MI:SS'),100,'Paid','The document is paid',200,70,17,319,'N',0,'N','IsPaid','Y','D',1402,'7d2f7567-fb4f-44b0-a098-ddaa81ca7a4f','N') +; + +SELECT register_migration_script('201710251241_IDEMPIERE-3529.sql') FROM dual +; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java index 2c2c1d907e..768c5ecab4 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java @@ -68,6 +68,8 @@ public class InvoicePrint extends SvrProcess protected int m_C_Invoice_ID = 0; protected String m_DocumentNo_From = null; protected String m_DocumentNo_To = null; + private String p_IsPaid = null; + private int m_C_DocType_ID = 0; protected volatile StringBuffer sql = new StringBuffer(); protected volatile List params = new ArrayList(); @@ -101,6 +103,10 @@ public class InvoicePrint extends SvrProcess m_DocumentNo_From = (String)para[i].getParameter(); m_DocumentNo_To = (String)para[i].getParameter_To(); } + else if (name.equals("IsPaid")) + p_IsPaid = (String)para[i].getParameter(); + else if (name.equals("C_DocType_ID")) + m_C_DocType_ID = para[i].getParameterAsInt(); else log.log(Level.SEVERE, "prepare - Unknown Parameter: " + name); } @@ -124,7 +130,9 @@ public class InvoicePrint extends SvrProcess + ", C_Invoice_ID=" + m_C_Invoice_ID + ", EmailPDF=" + p_EMailPDF + ",R_MailText_ID=" + p_R_MailText_ID + ", DateInvoiced=" + m_dateInvoiced_From + "-" + m_dateInvoiced_To - + ", DocumentNo=" + m_DocumentNo_From + "-" + m_DocumentNo_To); + + ", DocumentNo=" + m_DocumentNo_From + "-" + m_DocumentNo_To + + ", IsPaid=" + p_IsPaid + + ", C_DocType_ID=" + m_C_DocType_ID); MMailText mText = null; if (p_R_MailText_ID != 0) @@ -377,6 +385,14 @@ public class InvoicePrint extends SvrProcess /* if emailed to customer only select COmpleted & CLosed invoices */ sql.append(" AND i.DocStatus IN ('CO','CL') "); } + if (p_IsPaid != null && p_IsPaid.length() == 1) + { + sql.append(" AND i.IsPaid='").append(p_IsPaid).append("'"); + } + if (m_C_DocType_ID != 0) + { + sql.append (" AND i.C_DocTypeTarget_ID=").append(m_C_DocType_ID); + } } String orgWhere = MRole.getDefault(getCtx(), false).getOrgWhere(MRole.SQL_RO); if (!Util.isEmpty(orgWhere, true)) { From 267fab419a18888c599577dcea6eb494717dcbb9 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 25 Oct 2017 18:41:23 +0200 Subject: [PATCH 11/14] IDEMPIERE-3529 - Add parameters to InvoicePrint process / peer review --- migration/i4.1/oracle/201710251241_IDEMPIERE-3529.sql | 2 +- migration/i4.1/postgresql/201710251241_IDEMPIERE-3529.sql | 2 +- .../src/org/compiere/process/OrderBatchProcess.java | 2 +- .../src/org/adempiere/webui/process/InvoicePrint.java | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/migration/i4.1/oracle/201710251241_IDEMPIERE-3529.sql b/migration/i4.1/oracle/201710251241_IDEMPIERE-3529.sql index e2d6ee3dad..d4434c7ef0 100644 --- a/migration/i4.1/oracle/201710251241_IDEMPIERE-3529.sql +++ b/migration/i4.1/oracle/201710251241_IDEMPIERE-3529.sql @@ -3,7 +3,7 @@ SET DEFINE OFF -- IDEMPIERE-3529 - Add parameters to InvoicePrint process -- Oct 25, 2017 12:09:30 PM CEST -INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,AD_Val_Rule_ID,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200219,0,0,'Y',TO_DATE('2017-10-25 12:09:30','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2017-10-25 12:09:30','YYYY-MM-DD HH24:MI:SS'),100,'Document Type','Document type or rules','The Document Type determines document sequence and processing rules',200,60,19,170,'N',200097,0,'N','C_DocType_ID','Y','D',196,'554013bb-d6c0-4795-a9c6-aa2cb6dfc2bf','N') +INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,AD_Val_Rule_ID,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200219,0,0,'Y',TO_DATE('2017-10-25 12:09:30','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2017-10-25 12:09:30','YYYY-MM-DD HH24:MI:SS'),100,'Document Type','Document type or rules','The Document Type determines document sequence and processing rules',200,60,19,170,'N',124,0,'N','C_DocType_ID','Y','D',196,'554013bb-d6c0-4795-a9c6-aa2cb6dfc2bf','N') ; -- Oct 25, 2017 12:16:28 PM CEST diff --git a/migration/i4.1/postgresql/201710251241_IDEMPIERE-3529.sql b/migration/i4.1/postgresql/201710251241_IDEMPIERE-3529.sql index 7eba976b0d..b2f1b7d9c8 100644 --- a/migration/i4.1/postgresql/201710251241_IDEMPIERE-3529.sql +++ b/migration/i4.1/postgresql/201710251241_IDEMPIERE-3529.sql @@ -1,6 +1,6 @@ -- IDEMPIERE-3529 - Add parameters to InvoicePrint process -- Oct 25, 2017 12:09:30 PM CEST -INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,AD_Val_Rule_ID,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200219,0,0,'Y',TO_TIMESTAMP('2017-10-25 12:09:30','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-10-25 12:09:30','YYYY-MM-DD HH24:MI:SS'),100,'Document Type','Document type or rules','The Document Type determines document sequence and processing rules',200,60,19,170,'N',200097,0,'N','C_DocType_ID','Y','D',196,'554013bb-d6c0-4795-a9c6-aa2cb6dfc2bf','N') +INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,AD_Val_Rule_ID,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200219,0,0,'Y',TO_TIMESTAMP('2017-10-25 12:09:30','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-10-25 12:09:30','YYYY-MM-DD HH24:MI:SS'),100,'Document Type','Document type or rules','The Document Type determines document sequence and processing rules',200,60,19,170,'N',124,0,'N','C_DocType_ID','Y','D',196,'554013bb-d6c0-4795-a9c6-aa2cb6dfc2bf','N') ; -- Oct 25, 2017 12:16:28 PM CEST diff --git a/org.adempiere.base.process/src/org/compiere/process/OrderBatchProcess.java b/org.adempiere.base.process/src/org/compiere/process/OrderBatchProcess.java index 1016fbbde4..9cc884d1dc 100644 --- a/org.adempiere.base.process/src/org/compiere/process/OrderBatchProcess.java +++ b/org.adempiere.base.process/src/org/compiere/process/OrderBatchProcess.java @@ -105,7 +105,7 @@ public class OrderBatchProcess extends SvrProcess StringBuilder sql = new StringBuilder("SELECT * FROM C_Order o ") .append(" WHERE o.C_DocTypeTarget_ID=? AND o.DocStatus=? "); if (p_IsSelfService != null && p_IsSelfService.length() == 1) - sql.append(" AND o.IsSelfService='").append(p_IsSelfService).append("'"); + sql.append(" AND o.IsSelfService=").append(DB.TO_STRING(p_IsSelfService)); if (p_C_BPartner_ID != 0) sql.append(" AND o.C_BPartner_ID=").append(p_C_BPartner_ID); if (p_DateOrdered_From != null) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java index 768c5ecab4..b87a0adbe4 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java @@ -387,11 +387,13 @@ public class InvoicePrint extends SvrProcess } if (p_IsPaid != null && p_IsPaid.length() == 1) { - sql.append(" AND i.IsPaid='").append(p_IsPaid).append("'"); + sql.append(" AND i.IsPaid=?"); + params.add(p_IsPaid); } if (m_C_DocType_ID != 0) { - sql.append (" AND i.C_DocTypeTarget_ID=").append(m_C_DocType_ID); + sql.append (" AND i.C_DocTypeTarget_ID=?"); + params.add(m_C_DocType_ID); } } String orgWhere = MRole.getDefault(getCtx(), false).getOrgWhere(MRole.SQL_RO); From 43300bdfc28a3105b734a0217817e4bcd5951efe Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 26 Oct 2017 10:16:49 +0800 Subject: [PATCH 12/14] IDEMPIERE-3514 Production: Could not save MA for Production line --- .../org/compiere/model/MProductionLine.java | 16 ++++--- .../org/compiere/model/MStorageOnHand.java | 46 ++++++++++++++++++- 2 files changed, 55 insertions(+), 7 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MProductionLine.java b/org.adempiere.base/src/org/compiere/model/MProductionLine.java index f88cf1f198..3cd26ae903 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductionLine.java +++ b/org.adempiere.base/src/org/compiere/model/MProductionLine.java @@ -114,17 +114,21 @@ public class MProductionLine extends X_M_ProductionLine { } Timestamp dateMPolicy = date; if(getM_AttributeSetInstance_ID()>0){ - Timestamp t = MStorageOnHand.getDateMaterialPolicy(getM_Product_ID(), getM_AttributeSetInstance_ID(), get_TrxName()); + Timestamp t = MStorageOnHand.getDateMaterialPolicy(getM_Product_ID(), getM_AttributeSetInstance_ID(), getM_Locator_ID(), get_TrxName()); if (t != null) dateMPolicy = t; } dateMPolicy = Util.removeTime(dateMPolicy); - MProductionLineMA lineMA = new MProductionLineMA( this, - asi.get_ID(), getMovementQty(),dateMPolicy); - if ( !lineMA.save(get_TrxName()) ) { - log.log(Level.SEVERE, "Could not save MA for " + toString()); - errorString.append("Could not save MA for " + toString() + "\n" ); + //for reversal, keep the ma copy from original trx + if (reversalId <= 0 ) + { + MProductionLineMA lineMA = new MProductionLineMA( this, + asi.get_ID(), getMovementQty(),dateMPolicy); + if ( !lineMA.save(get_TrxName()) ) { + log.log(Level.SEVERE, "Could not save MA for " + toString()); + errorString.append("Could not save MA for " + toString() + "\n" ); + } } MTransaction matTrx = new MTransaction (getCtx(), getAD_Org_ID(), "P+", diff --git a/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java b/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java index 677522cfe4..46e40e675c 100644 --- a/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java +++ b/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java @@ -1035,7 +1035,8 @@ public class MStorageOnHand extends X_M_StorageOnHand * * @param M_Product_ID * @param M_AttributeSetInstance_ID - * @return + * @param trxName + * @return datempolicy timestamp */ public static Timestamp getDateMaterialPolicy(int M_Product_ID, int M_AttributeSetInstance_ID,String trxName){ @@ -1068,6 +1069,49 @@ public class MStorageOnHand extends X_M_StorageOnHand } + return null; + } //getDateMaterialPolicy + + /** + * + * @param M_Product_ID + * @param M_AttributeSetInstance_ID + * @param M_Locator_ID + * @param trxName + * @return datempolicy timestamp + */ + public static Timestamp getDateMaterialPolicy(int M_Product_ID, int M_AttributeSetInstance_ID, int M_Locator_ID, String trxName){ + + if (M_Product_ID <= 0 || M_AttributeSetInstance_ID <= 0) + return null; + + String sql = "SELECT dateMaterialPolicy FROM M_StorageOnHand WHERE M_Product_ID=? and M_AttributeSetInstance_ID=? AND M_Locator_ID=?"; + + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement(sql, trxName); + pstmt.setInt(1, M_Product_ID); + pstmt.setInt(2, M_AttributeSetInstance_ID); + pstmt.setInt(3, M_Locator_ID); + + rs = pstmt.executeQuery(); + if (rs.next()) + { + return rs.getTimestamp(1); + } + } catch (SQLException ex) + { + s_log.log(Level.SEVERE, sql, ex); + + }finally + { + DB.close(rs, pstmt); + rs = null; pstmt = null; + } + + return null; } //getDateMaterialPolicy } // MStorageOnHand From f5b85983cdd3185a27296539c529c536020c59aa Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 31 Oct 2017 17:20:57 +0100 Subject: [PATCH 13/14] IDEMPIERE-1052 Improve Performance using Search instead of Table/Table Direct / AD_ChangeLog.AD_Column_ID --- migration/i4.1/oracle/201710311719_IDEMPIERE-1052.sql | 11 +++++++++++ .../i4.1/postgresql/201710311719_IDEMPIERE-1052.sql | 8 ++++++++ 2 files changed, 19 insertions(+) create mode 100644 migration/i4.1/oracle/201710311719_IDEMPIERE-1052.sql create mode 100644 migration/i4.1/postgresql/201710311719_IDEMPIERE-1052.sql diff --git a/migration/i4.1/oracle/201710311719_IDEMPIERE-1052.sql b/migration/i4.1/oracle/201710311719_IDEMPIERE-1052.sql new file mode 100644 index 0000000000..73bc120d14 --- /dev/null +++ b/migration/i4.1/oracle/201710311719_IDEMPIERE-1052.sql @@ -0,0 +1,11 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-1052 Improve Performance using Search instead of Table/Table Direct +-- Oct 31, 2017 5:15:03 PM CET +UPDATE AD_Column SET AD_Reference_ID=30, IsUpdateable='N', FKConstraintType=NULL,Updated=TO_DATE('2017-10-31 17:15:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=8814 +; + +SELECT register_migration_script('201710311719_IDEMPIERE-1052.sql') FROM dual +; + diff --git a/migration/i4.1/postgresql/201710311719_IDEMPIERE-1052.sql b/migration/i4.1/postgresql/201710311719_IDEMPIERE-1052.sql new file mode 100644 index 0000000000..7ab21ef140 --- /dev/null +++ b/migration/i4.1/postgresql/201710311719_IDEMPIERE-1052.sql @@ -0,0 +1,8 @@ +-- IDEMPIERE-1052 Improve Performance using Search instead of Table/Table Direct +-- Oct 31, 2017 5:15:03 PM CET +UPDATE AD_Column SET AD_Reference_ID=30, IsUpdateable='N', FKConstraintType=NULL,Updated=TO_TIMESTAMP('2017-10-31 17:15:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=8814 +; + +SELECT register_migration_script('201710311719_IDEMPIERE-1052.sql') FROM dual +; + From 5dbdbc93aac9c89c2df38616f84e1ce9bb2fd2a4 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 31 Oct 2017 17:30:55 +0100 Subject: [PATCH 14/14] IDEMPIERE-3534 Webservice error - Cannot Access --- .../src/org/compiere/model/MRole.java | 14 +++++++------- .../idempiere/adinterface/ModelADServiceImpl.java | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MRole.java b/org.adempiere.base/src/org/compiere/model/MRole.java index 9eac524285..fc18c48743 100644 --- a/org.adempiere.base/src/org/compiere/model/MRole.java +++ b/org.adempiere.base/src/org/compiere/model/MRole.java @@ -61,7 +61,7 @@ public final class MRole extends X_AD_Role /** * */ - private static final long serialVersionUID = 3608297024439006903L; + private static final long serialVersionUID = 8952907008982481439L; /** * Get Default (Client) Role @@ -1488,7 +1488,7 @@ public final class MRole extends X_AD_Role * @param AD_Window_ID window * @return null in no access, TRUE if r/w and FALSE if r/o */ - public Boolean getWindowAccess (int AD_Window_ID) + public synchronized Boolean getWindowAccess (int AD_Window_ID) { if (m_windowAccess == null) { @@ -1575,7 +1575,7 @@ public final class MRole extends X_AD_Role * @param AD_Process_ID process * @return null in no access, TRUE if r/w and FALSE if r/o */ - public Boolean getProcessAccess (int AD_Process_ID) + public synchronized Boolean getProcessAccess (int AD_Process_ID) { if (m_processAccess == null) { @@ -1657,7 +1657,7 @@ public final class MRole extends X_AD_Role * @param AD_Task_ID task * @return null in no access, TRUE if r/w and FALSE if r/o */ - public Boolean getTaskAccess (int AD_Task_ID) + public synchronized Boolean getTaskAccess (int AD_Task_ID) { if (m_taskAccess == null) { @@ -1737,7 +1737,7 @@ public final class MRole extends X_AD_Role * @param AD_Form_ID form * @return null in no access, TRUE if r/w and FALSE if r/o */ - public Boolean getFormAccess (int AD_Form_ID) + public synchronized Boolean getFormAccess (int AD_Form_ID) { if (m_formAccess == null) { @@ -1817,7 +1817,7 @@ public final class MRole extends X_AD_Role * @param AD_Workflow_ID workflow * @return null in no access, TRUE if r/w and FALSE if r/o */ - public Boolean getWorkflowAccess (int AD_Workflow_ID) + public synchronized Boolean getWorkflowAccess (int AD_Workflow_ID) { if (m_workflowAccess == null) { @@ -3086,7 +3086,7 @@ public final class MRole extends X_AD_Role return whereClause.toString(); } - public Boolean getInfoAccess(int AD_InfoWindow_ID) { + public synchronized Boolean getInfoAccess(int AD_InfoWindow_ID) { if (m_infoAccess == null) { m_infoAccess = new HashMap(20); diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ModelADServiceImpl.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ModelADServiceImpl.java index 08fb2ee9b1..f672b8ba90 100644 --- a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ModelADServiceImpl.java +++ b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ModelADServiceImpl.java @@ -424,6 +424,8 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic reqprocess.setADRecordID(modelRunProcess.getADRecordID()); reqprocess.setDocAction(modelRunProcess.getDocAction()); RunProcessResponseDocument response = Process.runProcess(getCompiereService(), docprocess, getRequestCtx(), localTrxName); + if (response != null && response.getRunProcessResponse() != null && response.getRunProcessResponse().getIsError()) + log.warning("Error running webservice " + serviceType + " -> " + response.getRunProcessResponse().getError()); Map requestCtx = getRequestCtx(); requestCtx.put(serviceType+"_Summary", response.getRunProcessResponse().getSummary()); return response;