From e7730780ba34b7fb953ae956a6564de7c6785216 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 11 Apr 2014 12:10:56 -0500 Subject: [PATCH] IDEMPIERE-1877 Product Info Window Implementation broke the usage of barcode reader --- .../i2.0/oracle/201404111058_IDEMPIERE-1877.sql | 15 +++++++++++++++ .../postgresql/201404111058_IDEMPIERE-1877.sql | 12 ++++++++++++ .../src/org/compiere/model/MInfoWindow.java | 4 ++-- .../src/org/adempiere/webui/info/InfoWindow.java | 3 +-- .../adempiere/webui/panel/InfoGeneralPanel.java | 3 ++- 5 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 migration/i2.0/oracle/201404111058_IDEMPIERE-1877.sql create mode 100644 migration/i2.0/postgresql/201404111058_IDEMPIERE-1877.sql diff --git a/migration/i2.0/oracle/201404111058_IDEMPIERE-1877.sql b/migration/i2.0/oracle/201404111058_IDEMPIERE-1877.sql new file mode 100644 index 0000000000..00353213ec --- /dev/null +++ b/migration/i2.0/oracle/201404111058_IDEMPIERE-1877.sql @@ -0,0 +1,15 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Apr 11, 2014 10:56:44 AM COT +-- IDEMPIERE-1877 Product Info Window Implementation broke the usage of barcode reader +UPDATE AD_InfoColumn SET IsIdentifier='Y',Updated=TO_DATE('2014-04-11 10:56:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200003 +; + +-- Apr 11, 2014 10:56:47 AM COT +UPDATE AD_InfoColumn SET IsIdentifier='Y',Updated=TO_DATE('2014-04-11 10:56:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200004 +; + +SELECT register_migration_script('201404111058_IDEMPIERE-1877.sql') FROM dual +; + diff --git a/migration/i2.0/postgresql/201404111058_IDEMPIERE-1877.sql b/migration/i2.0/postgresql/201404111058_IDEMPIERE-1877.sql new file mode 100644 index 0000000000..92076941b6 --- /dev/null +++ b/migration/i2.0/postgresql/201404111058_IDEMPIERE-1877.sql @@ -0,0 +1,12 @@ +-- Apr 11, 2014 10:56:44 AM COT +-- IDEMPIERE-1877 Product Info Window Implementation broke the usage of barcode reader +UPDATE AD_InfoColumn SET IsIdentifier='Y',Updated=TO_TIMESTAMP('2014-04-11 10:56:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200003 +; + +-- Apr 11, 2014 10:56:47 AM COT +UPDATE AD_InfoColumn SET IsIdentifier='Y',Updated=TO_TIMESTAMP('2014-04-11 10:56:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200004 +; + +SELECT register_migration_script('201404111058_IDEMPIERE-1877.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 731dfbbc2f..64cbb0ff6f 100644 --- a/org.adempiere.base/src/org/compiere/model/MInfoWindow.java +++ b/org.adempiere.base/src/org/compiere/model/MInfoWindow.java @@ -81,7 +81,7 @@ public class MInfoWindow extends X_AD_InfoWindow Query query = new Query(getCtx(), MTable.get(getCtx(), I_AD_InfoColumn.Table_ID), I_AD_InfoColumn.COLUMNNAME_AD_InfoWindow_ID+"=?", get_TrxName()); List list = query.setParameters(getAD_InfoWindow_ID()) .setOnlyActiveRecords(true) - .setOrderBy(I_AD_InfoColumn.COLUMNNAME_SeqNo) + .setOrderBy("SeqNo, AD_InfoColumn_ID") .list(); for(int i = list.size() - 1; i >= 0; i--) { MInfoColumn infoColumn = list.get(i); @@ -95,7 +95,7 @@ public class MInfoWindow extends X_AD_InfoWindow Query query = new Query(getCtx(), MTable.get(getCtx(), I_AD_InfoColumn.Table_ID), I_AD_InfoColumn.COLUMNNAME_AD_InfoWindow_ID+"=?", get_TrxName()); List list = query.setParameters(getAD_InfoWindow_ID()) .setOnlyActiveRecords(true) - .setOrderBy(I_AD_InfoColumn.COLUMNNAME_SeqNo) + .setOrderBy("SeqNo, AD_InfoColumn_ID") .list(); return list.toArray(new MInfoColumn[0]); } 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 eb1c725063..eac6e378ee 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 @@ -140,8 +140,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL } private void processQueryValue() { - //try first 2 only - for(int i = 0; i < identifiers.size() && i < 2; i++) { + for (int i = 0; i < identifiers.size(); i++) { WEditor editor = identifiers.get(i); editor.setValue(queryValue); testCount(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java index fe9d84a848..d9c513b40b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java @@ -122,7 +122,8 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener if (queryValue != null && queryValue.length() > 0) { MTable table = MTable.get(Env.getCtx(), p_tableName); - if (table.getIdentifierColumns().length > 1) + if ( table.getIdentifierColumns().length > 1 + && !p_tableName.startsWith("AD_")) // 32 AD tables with identifiers containing _ { String separator = I_C_ElementValue.Table_Name.equalsIgnoreCase(p_tableName) ? "-" : "_"; if (txt2.isVisible())