From d5ef3c327a9dd14fef6658dcdbf9a60e9400f424 Mon Sep 17 00:00:00 2001 From: Kirit Thummar Date: Wed, 22 Aug 2012 11:01:07 +0530 Subject: [PATCH] IDEMPIERE-377 : Add search sequence support for search dialog field[1001253] --- db/ddlutils/oracle/views/AD_FIELD_V.sql | 3 +- db/ddlutils/oracle/views/AD_FIELD_VT.sql | 3 +- db/ddlutils/postgresql/views/AD_FIELD_V.sql | 3 +- db/ddlutils/postgresql/views/AD_FIELD_VT.sql | 3 +- .../880_IDEMPIERE-377_SeqNoSelection.sql | 210 ++++++++++++++++++ .../oracle/885_IDEMPIERE-377_AD_Field_V.sql | 77 +++++++ .../880_IDEMPIERE-377_SeqNoSelection.sql | 210 ++++++++++++++++++ .../885_IDEMPIERE-377_AD_Field_V.sql | 58 +++++ .../src/org/compiere/model/GridField.java | 8 + .../src/org/compiere/model/GridFieldVO.java | 5 + .../src/org/compiere/model/MQuery.java | 2 +- .../adempiere/webui/window/FindWindow.java | 22 +- 12 files changed, 597 insertions(+), 7 deletions(-) create mode 100644 migration/360lts-release/oracle/880_IDEMPIERE-377_SeqNoSelection.sql create mode 100644 migration/360lts-release/oracle/885_IDEMPIERE-377_AD_Field_V.sql create mode 100644 migration/360lts-release/postgresql/880_IDEMPIERE-377_SeqNoSelection.sql create mode 100644 migration/360lts-release/postgresql/885_IDEMPIERE-377_AD_Field_V.sql diff --git a/db/ddlutils/oracle/views/AD_FIELD_V.sql b/db/ddlutils/oracle/views/AD_FIELD_V.sql index b88627de6c..eb55be2a8b 100644 --- a/db/ddlutils/oracle/views/AD_FIELD_V.sql +++ b/db/ddlutils/oracle/views/AD_FIELD_V.sql @@ -18,7 +18,8 @@ CREATE OR REPLACE VIEW AD_FIELD_V AS COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass, c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, f.isdisplayedgrid, - f.seqnogrid + f.seqnogrid, + c.seqnoselection FROM AD_FIELD f INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID) LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID) diff --git a/db/ddlutils/oracle/views/AD_FIELD_VT.sql b/db/ddlutils/oracle/views/AD_FIELD_VT.sql index 768432db9b..aafbdcad10 100644 --- a/db/ddlutils/oracle/views/AD_FIELD_VT.sql +++ b/db/ddlutils/oracle/views/AD_FIELD_VT.sql @@ -17,7 +17,8 @@ CREATE OR REPLACE VIEW AD_FIELD_VT AS COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass, c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, f.isdisplayedgrid, - f.seqnogrid + f.seqnogrid, + c.seqnoselection FROM AD_FIELD f INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID) INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID) diff --git a/db/ddlutils/postgresql/views/AD_FIELD_V.sql b/db/ddlutils/postgresql/views/AD_FIELD_V.sql index 2afd58d536..fe0e4cc7c3 100644 --- a/db/ddlutils/postgresql/views/AD_FIELD_V.sql +++ b/db/ddlutils/postgresql/views/AD_FIELD_V.sql @@ -14,7 +14,8 @@ CREATE OR REPLACE VIEW ad_field_v AS COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, f.isdisplayedgrid, - f.seqnogrid + f.seqnogrid, + c.seqnoselection FROM ad_field f JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id diff --git a/db/ddlutils/postgresql/views/AD_FIELD_VT.sql b/db/ddlutils/postgresql/views/AD_FIELD_VT.sql index f69e831133..5b79d61f60 100644 --- a/db/ddlutils/postgresql/views/AD_FIELD_VT.sql +++ b/db/ddlutils/postgresql/views/AD_FIELD_VT.sql @@ -9,7 +9,8 @@ CREATE OR REPLACE VIEW ad_field_vt AS f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, f.isdisplayedgrid, - f.seqnogrid + f.seqnogrid, + c.seqnoselection FROM ad_field f JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id diff --git a/migration/360lts-release/oracle/880_IDEMPIERE-377_SeqNoSelection.sql b/migration/360lts-release/oracle/880_IDEMPIERE-377_SeqNoSelection.sql new file mode 100644 index 0000000000..b013b9f6b4 --- /dev/null +++ b/migration/360lts-release/oracle/880_IDEMPIERE-377_SeqNoSelection.sql @@ -0,0 +1,210 @@ +-- Aug 20, 2012 11:14:07 PM IST +-- Add search sequence support for search dialog +INSERT INTO AD_Element (ColumnName,AD_Element_ID,Help,EntityType,Description,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('Selection_Column_SeqNo',200096,'For ordering sequence of selection column','U','Selection Column Sequence','Selection Column Sequence','Selection Column Sequence','6274682b-ac0f-47e8-9fbb-af34b4d69d89',0,TO_DATE('2012-08-20 23:14:06','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-08-20 23:14:06','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Aug 20, 2012 11:14:07 PM IST +-- Add search sequence support for search dialog +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200096 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Aug 20, 2012 11:17:08 PM IST +-- Add search sequence support for search dialog +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (0,101,200323,'U','N','N','N',0,'N',14,'N',11,'N','N',200096,'N','Y','97599ffb-8d35-48d1-b3c3-d0751a12563e','N','Y','N','Selection_Column_SeqNo','Selection Column Sequence','For ordering sequence of selection column','Selection Column Sequence','Y',100,TO_DATE('2012-08-20 23:17:07','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-08-20 23:17:07','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Aug 20, 2012 11:17:08 PM IST +-- Add search sequence support for search dialog +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200323 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Aug 20, 2012 11:17:48 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Element SET ColumnName='SeqNoSelection',Updated=TO_DATE('2012-08-20 23:17:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200096 +; + +-- Aug 20, 2012 11:17:48 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Column SET ColumnName='SeqNoSelection', Name='Selection Column Sequence', Description='Selection Column Sequence', Help='For ordering sequence of selection column' WHERE AD_Element_ID=200096 +; + +-- Aug 20, 2012 11:17:48 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Process_Para SET ColumnName='SeqNoSelection', Name='Selection Column Sequence', Description='Selection Column Sequence', Help='For ordering sequence of selection column', AD_Element_ID=200096 WHERE UPPER(ColumnName)='SEQNOSELECTION' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Aug 20, 2012 11:17:48 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Process_Para SET ColumnName='SeqNoSelection', Name='Selection Column Sequence', Description='Selection Column Sequence', Help='For ordering sequence of selection column' WHERE AD_Element_ID=200096 AND IsCentrallyMaintained='Y' +; + +-- Aug 20, 2012 11:18:20 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Column SET Description='Selection Column Sequence ',Updated=TO_DATE('2012-08-20 23:18:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200323 +; + +-- Aug 20, 2012 11:18:20 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET Name='Selection Column Sequence', Description='Selection Column Sequence ', Help='For ordering sequence of selection column' WHERE AD_Column_ID=200323 AND IsCentrallyMaintained='Y' +; + +-- Aug 20, 2012 11:18:28 PM IST +-- Add search sequence support for search dialog +ALTER TABLE AD_Column ADD SeqNoSelection NUMBER(10) DEFAULT NULL +; + +-- Aug 20, 2012 11:19:29 PM IST +-- Add search sequence support for search dialog +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',101,14,'N','N',200323,'Y',200288,'N','For ordering sequence of selection column','U','Selection Column Sequence','Selection Column Sequence','N','Y','6efc25d8-6850-4e4e-ba45-12c19a7561ec',100,0,TO_DATE('2012-08-20 23:19:28','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-08-20 23:19:28','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Aug 20, 2012 11:19:29 PM IST +-- Add search sequence support for search dialog +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200288 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=56374 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=2526 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=171 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=54403 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=2574 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=2573 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=160 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=161 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=162 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=166 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=2370 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=169 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=10128 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=4941 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=50188 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=168 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=159 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=340,IsDisplayed='Y' WHERE AD_Field_ID=825 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=350,IsDisplayed='Y' WHERE AD_Field_ID=4940 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=360,IsDisplayed='Y' WHERE AD_Field_ID=200288 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=370,IsDisplayed='Y' WHERE AD_Field_ID=167 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=380,IsDisplayed='Y' WHERE AD_Field_ID=5121 +; + +-- Aug 20, 2012 11:20:43 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=390,IsDisplayed='Y' WHERE AD_Field_ID=56317 +; + +-- Aug 20, 2012 11:20:43 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=400,IsDisplayed='Y' WHERE AD_Field_ID=62467 +; + +-- Aug 20, 2012 11:20:43 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=410,IsDisplayed='Y' WHERE AD_Field_ID=5122 +; + +-- Aug 20, 2012 11:20:43 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=420,IsDisplayed='Y' WHERE AD_Field_ID=200286 +; + +-- Aug 20, 2012 11:27:34 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET IsSameLine='Y',Updated=TO_DATE('2012-08-20 23:27:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200288 +; + +-- Aug 20, 2012 11:33:11 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET DisplayLogic='@IsSelectionColumn@=''Y''',Updated=TO_DATE('2012-08-20 23:33:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200288 +; + +UPDATE AD_System + SET LastMigrationScriptApplied='880_IDEMPIERE-377_SeqNoSelection.sql' +WHERE LastMigrationScriptApplied<'880_IDEMPIERE-377_SeqNoSelection.sql' + OR LastMigrationScriptApplied IS NULL +; \ No newline at end of file diff --git a/migration/360lts-release/oracle/885_IDEMPIERE-377_AD_Field_V.sql b/migration/360lts-release/oracle/885_IDEMPIERE-377_AD_Field_V.sql new file mode 100644 index 0000000000..2965a76066 --- /dev/null +++ b/migration/360lts-release/oracle/885_IDEMPIERE-377_AD_Field_V.sql @@ -0,0 +1,77 @@ +-- Aug 20, 2012 11:20:42 PM IST + +CREATE OR REPLACE VIEW AD_FIELD_V AS + SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID, + f.NAME, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength, + f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly, + f.IsEncrypted AS IsEncryptedField, f.ObscureType, + c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat, + COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue, + c.IsKey, c.IsParent, + COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory, + c.IsIdentifier, c.IsTranslated, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID, + c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID, + COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) AS AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable, + c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn, + c.IsSelectionColumn, + tbl.TableName, c.ValueMin, c.ValueMax, + fg.NAME AS FieldGroup, vr.Code AS ValidationCode, + f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault, + COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass, + c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, + f.isdisplayedgrid, + f.seqnogrid, + c.seqnoselection +FROM AD_FIELD f + INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID) + LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID) + LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID) + INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID) + INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID) + LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID = COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID)) +WHERE f.IsActive = 'Y' + AND c.IsActive = 'Y'; + + +-- Aug 20, 2012 11:20:42 PM IST ----- + + + CREATE OR REPLACE VIEW AD_FIELD_VT AS + SELECT trl.AD_LANGUAGE, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID, + trl.NAME, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength, + f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly, + f.IsEncrypted AS IsEncryptedField, f.ObscureType, + c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat, + COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue, + c.IsKey, c.IsParent, + COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory, + c.IsIdentifier, c.IsTranslated, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID, + c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID, + COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) as AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable, + c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn, c.IsSelectionColumn, + tbl.TableName, c.ValueMin, c.ValueMax, + fgt.NAME AS FieldGroup, vr.Code AS ValidationCode, + f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault, + COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass, + c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, + f.isdisplayedgrid, + f.seqnogrid, + c.seqnoselection + FROM AD_FIELD f + INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID) + INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID) + LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID) + LEFT OUTER JOIN AD_FIELDGROUP_TRL fgt ON + (f.AD_FieldGroup_ID = fgt.AD_FieldGroup_ID AND trl.AD_LANGUAGE=fgt.AD_LANGUAGE) + LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID) + INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID) + INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID) + LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID=COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID)) + WHERE f.IsActive = 'Y' + AND c.IsActive = 'Y'; + +UPDATE AD_System + SET LastMigrationScriptApplied='885_IDEMPIERE-377_AD_Field_V.sql' +WHERE LastMigrationScriptApplied<'885_IDEMPIERE-377_AD_Field_V.sql' + OR LastMigrationScriptApplied IS NULL +; \ No newline at end of file diff --git a/migration/360lts-release/postgresql/880_IDEMPIERE-377_SeqNoSelection.sql b/migration/360lts-release/postgresql/880_IDEMPIERE-377_SeqNoSelection.sql new file mode 100644 index 0000000000..765e01d382 --- /dev/null +++ b/migration/360lts-release/postgresql/880_IDEMPIERE-377_SeqNoSelection.sql @@ -0,0 +1,210 @@ +-- Aug 20, 2012 11:14:07 PM IST +-- Add search sequence support for search dialog +INSERT INTO AD_Element (ColumnName,AD_Element_ID,Help,EntityType,Description,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('Selection_Column_SeqNo',200096,'For ordering sequence of selection column','U','Selection Column Sequence','Selection Column Sequence','Selection Column Sequence','6274682b-ac0f-47e8-9fbb-af34b4d69d89',0,TO_TIMESTAMP('2012-08-20 23:14:06','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-08-20 23:14:06','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Aug 20, 2012 11:14:07 PM IST +-- Add search sequence support for search dialog +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200096 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Aug 20, 2012 11:17:08 PM IST +-- Add search sequence support for search dialog +INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (0,101,200323,'U','N','N','N',0,'N',14,'N',11,'N','N',200096,'N','Y','97599ffb-8d35-48d1-b3c3-d0751a12563e','N','Y','N','Selection_Column_SeqNo','Selection Column Sequence','For ordering sequence of selection column','Selection Column Sequence','Y',100,TO_TIMESTAMP('2012-08-20 23:17:07','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-08-20 23:17:07','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Aug 20, 2012 11:17:08 PM IST +-- Add search sequence support for search dialog +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200323 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Aug 20, 2012 11:17:48 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Element SET ColumnName='SeqNoSelection',Updated=TO_TIMESTAMP('2012-08-20 23:17:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200096 +; + +-- Aug 20, 2012 11:17:48 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Column SET ColumnName='SeqNoSelection', Name='Selection Column Sequence', Description='Selection Column Sequence', Help='For ordering sequence of selection column' WHERE AD_Element_ID=200096 +; + +-- Aug 20, 2012 11:17:48 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Process_Para SET ColumnName='SeqNoSelection', Name='Selection Column Sequence', Description='Selection Column Sequence', Help='For ordering sequence of selection column', AD_Element_ID=200096 WHERE UPPER(ColumnName)='SEQNOSELECTION' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Aug 20, 2012 11:17:48 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Process_Para SET ColumnName='SeqNoSelection', Name='Selection Column Sequence', Description='Selection Column Sequence', Help='For ordering sequence of selection column' WHERE AD_Element_ID=200096 AND IsCentrallyMaintained='Y' +; + +-- Aug 20, 2012 11:18:20 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Column SET Description='Selection Column Sequence ',Updated=TO_TIMESTAMP('2012-08-20 23:18:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200323 +; + +-- Aug 20, 2012 11:18:20 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET Name='Selection Column Sequence', Description='Selection Column Sequence ', Help='For ordering sequence of selection column' WHERE AD_Column_ID=200323 AND IsCentrallyMaintained='Y' +; + +-- Aug 20, 2012 11:18:28 PM IST +-- Add search sequence support for search dialog +ALTER TABLE AD_Column ADD COLUMN SeqNoSelection NUMERIC(10) DEFAULT NULL +; + +-- Aug 20, 2012 11:19:29 PM IST +-- Add search sequence support for search dialog +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',101,14,'N','N',200323,'Y',200288,'N','For ordering sequence of selection column','U','Selection Column Sequence','Selection Column Sequence','N','Y','6efc25d8-6850-4e4e-ba45-12c19a7561ec',100,0,TO_TIMESTAMP('2012-08-20 23:19:28','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-08-20 23:19:28','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Aug 20, 2012 11:19:29 PM IST +-- Add search sequence support for search dialog +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200288 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=56374 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=2526 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=171 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=54403 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=2574 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=2573 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=160 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=161 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=162 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=166 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=2370 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=169 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=10128 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=4941 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=50188 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=168 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=159 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=340,IsDisplayed='Y' WHERE AD_Field_ID=825 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=350,IsDisplayed='Y' WHERE AD_Field_ID=4940 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=360,IsDisplayed='Y' WHERE AD_Field_ID=200288 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=370,IsDisplayed='Y' WHERE AD_Field_ID=167 +; + +-- Aug 20, 2012 11:20:42 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=380,IsDisplayed='Y' WHERE AD_Field_ID=5121 +; + +-- Aug 20, 2012 11:20:43 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=390,IsDisplayed='Y' WHERE AD_Field_ID=56317 +; + +-- Aug 20, 2012 11:20:43 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=400,IsDisplayed='Y' WHERE AD_Field_ID=62467 +; + +-- Aug 20, 2012 11:20:43 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=410,IsDisplayed='Y' WHERE AD_Field_ID=5122 +; + +-- Aug 20, 2012 11:20:43 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET SeqNo=420,IsDisplayed='Y' WHERE AD_Field_ID=200286 +; + +-- Aug 20, 2012 11:27:34 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2012-08-20 23:27:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200288 +; + +-- Aug 20, 2012 11:33:11 PM IST +-- Add search sequence support for search dialog +UPDATE AD_Field SET DisplayLogic='@IsSelectionColumn@=''Y''',Updated=TO_TIMESTAMP('2012-08-20 23:33:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200288 +; + +UPDATE AD_System + SET LastMigrationScriptApplied='880_IDEMPIERE-377_SeqNoSelection.sql' +WHERE LastMigrationScriptApplied<'880_IDEMPIERE-377_SeqNoSelection.sql' + OR LastMigrationScriptApplied IS NULL +; diff --git a/migration/360lts-release/postgresql/885_IDEMPIERE-377_AD_Field_V.sql b/migration/360lts-release/postgresql/885_IDEMPIERE-377_AD_Field_V.sql new file mode 100644 index 0000000000..59648f643e --- /dev/null +++ b/migration/360lts-release/postgresql/885_IDEMPIERE-377_AD_Field_V.sql @@ -0,0 +1,58 @@ +-- Aug 20, 2012 11:20:42 PM IST ---- +CREATE OR REPLACE VIEW ad_field_v AS + SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, + f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, + f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, + f.obscuretype, c.columnname, c.columnsql, c.fieldlength, c.vformat, + COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent, + COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, + COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, + COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, + COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, + c.isalwaysupdateable, c.readonlylogic, c.mandatorylogic, c.isupdateable, + c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, + fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, + COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, + COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, + f.isdisplayedgrid, + f.seqnogrid, + c.seqnoselection + FROM ad_field f + JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id + LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id + LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id + JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id + JOIN ad_reference r ON c.ad_reference_id = r.ad_reference_id + LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) + WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar; + +-- Aug 20, 2012 11:20:42 PM IST ---- + CREATE OR REPLACE VIEW ad_field_vt AS + SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description, + trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, + f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, c.vformat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, + c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, + COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, + COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, c.isalwaysupdateable, c.readonlylogic, c.mandatorylogic, c.isupdateable, + c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode, + f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, + COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, + f.isdisplayedgrid, + f.seqnogrid, + c.seqnoselection + FROM ad_field f + JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id + JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id + LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id + LEFT JOIN ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language::text = fgt.ad_language::text + LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id + JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id + JOIN ad_reference r ON c.ad_reference_id = r.ad_reference_id + LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) + WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar; + +UPDATE AD_System + SET LastMigrationScriptApplied='885_IDEMPIERE-377_AD_Field_V.sql' +WHERE LastMigrationScriptApplied<'885_IDEMPIERE-377_AD_Field_V.sql' + OR LastMigrationScriptApplied IS NULL +; \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/model/GridField.java b/org.adempiere.base/src/org/compiere/model/GridField.java index 56b6a75778..55c0bbe187 100644 --- a/org.adempiere.base/src/org/compiere/model/GridField.java +++ b/org.adempiere.base/src/org/compiere/model/GridField.java @@ -1126,6 +1126,14 @@ public class GridField { return m_vo.IsSelectionColumn; } + /** + * Selection column sequence + * @return SeqNoSelection + */ + public int getSeqNoSelection() + { + return m_vo.SeqNoSelection; + } /** * Get Obscure Type * @return obscure diff --git a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java index 2b2753b047..79967a8746 100644 --- a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java +++ b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java @@ -136,6 +136,8 @@ public class GridFieldVO implements Serializable vo.IsEncryptedColumn = "Y".equals(rs.getString (i)); else if (columnName.equalsIgnoreCase("IsSelectionColumn")) vo.IsSelectionColumn = "Y".equals(rs.getString (i)); + else if (columnName.equalsIgnoreCase("SeqNoSelection")) + vo.SeqNoSelection = rs.getInt (i); else if (columnName.equalsIgnoreCase("SortNo")) vo.SortNo = rs.getInt (i); else if (columnName.equalsIgnoreCase("FieldLength")) @@ -449,6 +451,8 @@ public class GridFieldVO implements Serializable public boolean IsEncryptedColumn = false; /** Find Selection */ public boolean IsSelectionColumn = false; + /** Selection column sequence */ + public int SeqNoSelection = 0; /** Order By */ public int SortNo = 0; /** Field Length */ @@ -609,6 +613,7 @@ public class GridFieldVO implements Serializable clone.IsEncryptedField = IsEncryptedField; clone.IsEncryptedColumn = IsEncryptedColumn; clone.IsSelectionColumn = IsSelectionColumn; + clone.SeqNoSelection = SeqNoSelection; clone.IsAutocomplete = IsAutocomplete; clone.IsAllowCopy = IsAllowCopy; clone.SortNo = SortNo; diff --git a/org.adempiere.base/src/org/compiere/model/MQuery.java b/org.adempiere.base/src/org/compiere/model/MQuery.java index 1138ec43d3..5c80e79cfd 100644 --- a/org.adempiere.base/src/org/compiere/model/MQuery.java +++ b/org.adempiere.base/src/org/compiere/model/MQuery.java @@ -421,7 +421,7 @@ public class MQuery implements Serializable /** Between - 8 */ public static final int BETWEEN_INDEX = 8; /** For ticket 1001193 */ - public static final String NOT_NULL = "IS NOT NNULL"; + public static final String NOT_NULL = "IS NOT NULL"; /** For ticket 1001193 */ public static final String NULL = "IS NULL"; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index e874f629e0..da153f1a90 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -25,6 +25,8 @@ import java.sql.Statement; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; import java.util.Hashtable; import java.util.Iterator; import java.util.List; @@ -443,7 +445,8 @@ public class FindWindow extends Window implements EventListener, ValueCha private void initFind() { log.config(""); - + + ArrayList gridFieldList = new ArrayList(); // Get Info from target Tab for (int i = 0; i < m_findFields.length; i++) { @@ -494,12 +497,27 @@ public class FindWindow extends Window implements EventListener, ValueCha } if (mField.isSelectionColumn()) - addSelectionColumn (mField); + gridFieldList.add(mField); // TargetFields m_targetFields.put (new Integer(mField.getAD_Column_ID()), mField); } // for all target tab fields + + // added comparator on sequence of selection column for IDEMPIERE-377 + Collections.sort(gridFieldList, new Comparator() { + @Override + public int compare(GridField o1, GridField o2) { + return o1.getSeqNoSelection()-o2.getSeqNoSelection(); + } + }); + + // adding sorted columns + for(GridField field:gridFieldList){ + addSelectionColumn (field); + } + + gridFieldList = null; m_total = getNoOfRecords(null, false); } // initFind