From a34211b03213efaf9807d6670e0f3e76107c1095 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Fri, 9 Sep 2016 15:09:51 +0200 Subject: [PATCH 01/16] IDEMPIERE-3000 Automatic opening of menu entries at login --- .../oracle/201609091030_IDEMPIERE-3000.sql | 233 ++++++++++++++++++ .../201609091030_IDEMPIERE-3000.sql | 232 +++++++++++++++++ .../src/org/compiere/model/I_AD_TreeBar.java | 39 +++ .../src/org/compiere/model/MTree.java | 4 +- .../src/org/compiere/model/X_AD_TreeBar.java | 64 ++++- .../server.product.launch | 2 +- .../org/adempiere/webui/AdempiereWebUI.java | 75 +++++- .../webui/dashboard/DPFavourites.java | 46 ++-- 8 files changed, 676 insertions(+), 19 deletions(-) create mode 100644 migration/i3.1/oracle/201609091030_IDEMPIERE-3000.sql create mode 100644 migration/i3.1/postgresql/201609091030_IDEMPIERE-3000.sql diff --git a/migration/i3.1/oracle/201609091030_IDEMPIERE-3000.sql b/migration/i3.1/oracle/201609091030_IDEMPIERE-3000.sql new file mode 100644 index 0000000000..8b009d2479 --- /dev/null +++ b/migration/i3.1/oracle/201609091030_IDEMPIERE-3000.sql @@ -0,0 +1,233 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-3000 +-- Jan 12, 2016 10:23:45 AM CET +INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,PrintName,EntityType,AD_Element_UU) VALUES (202958,0,0,'Y',TO_DATE('2016-01-12 10:23:44','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:23:44','YYYY-MM-DD HH24:MI:SS'),100,'IsFavourite','Favourite','This record is a favourite','Favourite','U','0a31aa8d-9aad-48b2-855c-746f80b9f261') +; + +-- Jan 12, 2016 10:23:50 AM CET +UPDATE AD_Element SET EntityType='D',Updated=TO_DATE('2016-01-12 10:23:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=202958 +; + +-- Jan 12, 2016 10:24:57 AM CET +INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,PrintName,EntityType,AD_Element_UU) VALUES (202959,0,0,'Y',TO_DATE('2016-01-12 10:24:57','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:24:57','YYYY-MM-DD HH24:MI:SS'),100,'LoginOpenSeqNo','Login automatic open sequence','Determine the order items will be automatically opened when user logs in','Login automatic open sequence','D','4f45e332-f582-45ef-be7e-35f970fb3f74') +; + +-- Jan 12, 2016 10:25:30 AM CET +UPDATE AD_Column SET AD_Val_Rule_ID=150, IsUpdateable='N',Updated=TO_DATE('2016-01-12 10:25:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=6212 +; + +-- Jan 12, 2016 10:26:05 AM CET +INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (212587,0,'Favourite','This record is a favourite',456,'IsFavourite','Y',1,'N','N','Y','N','N',0,'N',20,0,0,'Y',TO_DATE('2016-01-12 10:26:04','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:26:04','YYYY-MM-DD HH24:MI:SS'),100,202958,'Y','N','U','N','N','N','Y','05a76d6a-3357-4ad7-b594-43652f111d49','Y',0,'N','N') +; + +-- Jan 12, 2016 10:26:06 AM CET +ALTER TABLE AD_TreeBar ADD IsFavourite CHAR(1) DEFAULT 'Y' CHECK (IsFavourite IN ('Y','N')) NOT NULL +; + +-- Jan 12, 2016 10:26:09 AM CET +ALTER TABLE AD_TreeBar MODIFY IsFavourite CHAR(1) DEFAULT 'Y' +; + +-- Jan 12, 2016 10:26:09 AM CET +UPDATE AD_TreeBar SET IsFavourite='Y' WHERE IsFavourite IS NULL +; + +-- Jan 12, 2016 10:26:25 AM CET +INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (212588,0,'Login automatic open sequence','Determine the order items will be automatically opened when user logs in',456,'LoginOpenSeqNo',10,'N','N','N','N','N',0,'N',11,0,0,'Y',TO_DATE('2016-01-12 10:26:25','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:26:25','YYYY-MM-DD HH24:MI:SS'),100,202959,'Y','N','U','N','N','N','Y','c0e29ca1-f92d-48aa-bd6b-b4d6ffb56ad5','Y',0,'N','N') +; + +-- Jan 12, 2016 10:26:25 AM CET +ALTER TABLE AD_TreeBar ADD LoginOpenSeqNo NUMBER(10) DEFAULT NULL +; + +-- Jan 12, 2016 10:26:38 AM CET +INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,ColumnSQL,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (212589,0,'Name','Alphanumeric identifier of the entity','The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.',456,'Name',60,'N','N','N','N','Y',0,'N',10,0,0,'Y',TO_DATE('2016-01-12 10:26:38','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:26:38','YYYY-MM-DD HH24:MI:SS'),100,469,'N','Y','U','N','N','(SELECT Name FROM AD_Menu WHERE AD_Menu_ID = AD_TreeBar.Node_ID)','N','Y','b9dd089d-3bdf-4140-a9bf-9801221cbb58','N',0,'N','N') +; + +-- Jan 12, 2016 10:26:54 AM CET +UPDATE AD_Column SET IsUpdateable='N', IsSelectionColumn='Y', SeqNoSelection=1,Updated=TO_DATE('2016-01-12 10:26:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=6212 +; + +-- Jan 12, 2016 10:26:58 AM CET +UPDATE AD_Column SET IsUpdateable='N', IsSelectionColumn='Y', SeqNoSelection=2,Updated=TO_DATE('2016-01-12 10:26:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=6214 +; + +-- Jan 12, 2016 10:27:03 AM CET +UPDATE AD_Column SET SeqNoSelection=3,Updated=TO_DATE('2016-01-12 10:27:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212589 +; + +-- Jan 12, 2016 10:27:19 AM CET +INSERT INTO AD_Window (AD_Window_ID,Name,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,WindowType,Processing,EntityType,IsSOTrx,IsDefault,WinHeight,WinWidth,IsBetaFunctionality,AD_Window_UU) VALUES (200083,'Menu favourites',0,0,'Y',TO_DATE('2016-01-12 10:27:18','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:27:18','YYYY-MM-DD HH24:MI:SS'),100,'M','N','D','Y','N',0,0,'N','6cc7d70f-6937-4dd0-bb29-1ae097e0e0c1') +; + +-- Jan 12, 2016 10:27:27 AM CET +UPDATE AD_Table SET AD_Window_ID=200083,Updated=TO_DATE('2016-01-12 10:27:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=456 +; + +-- Jan 12, 2016 10:27:51 AM CET +UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2016-01-12 10:27:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212587 +; + +-- Jan 12, 2016 10:27:58 AM CET +UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2016-01-12 10:27:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212588 +; + +-- Jan 12, 2016 10:28:03 AM CET +UPDATE AD_Table SET IsHighVolume='Y',Updated=TO_DATE('2016-01-12 10:28:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=456 +; + +-- Jan 12, 2016 10:29:03 AM CET +INSERT INTO AD_Tab (AD_Tab_ID,Name,Description,AD_Window_ID,SeqNo,IsSingleRow,AD_Table_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,HasTree,IsInfoTab,IsTranslationTab,IsReadOnly,Processing,ImportFields,TabLevel,IsSortTab,EntityType,IsInsertRecord,IsAdvancedTab,AD_Tab_UU,TreeDisplayedOn) VALUES (200209,'Menu entries','In this tab, you''ll be able to manage favourites and entries which will open automatically on login',200083,10,'N',456,0,0,'Y',TO_DATE('2016-01-12 10:29:03','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:29:03','YYYY-MM-DD HH24:MI:SS'),100,'N','N','N','N','N','N',0,'N','U','Y','N','aca32c5d-0142-42f5-809a-770e152efa85','B') +; + +-- Jan 12, 2016 10:29:13 AM CET +UPDATE AD_Tab SET EntityType='D',Updated=TO_DATE('2016-01-12 10:29:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200209 +; + +-- Jan 12, 2016 10:29:17 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (204110,'Client','Client/Tenant for this installation.','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.',200209,6205,'Y',22,10,'N','N','N','N',0,0,'Y',TO_DATE('2016-01-12 10:29:16','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:29:16','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','0740e23c-ec14-40b7-a389-56cee8660550','Y',10,2) +; + +-- Jan 12, 2016 10:29:17 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsAllowCopy,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (204111,'Organization','Organizational entity within client','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.',200209,6206,'Y',22,20,'N','N','N','N',0,0,'Y',TO_DATE('2016-01-12 10:29:17','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:29:17','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','5c0062ec-c924-4ef1-871f-f6e184696c2a','Y','Y',20,4,2) +; + +-- Jan 12, 2016 10:29:18 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (204112,'Name','Alphanumeric identifier of the entity','The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.',200209,212589,'Y',60,30,'N','N','N','N',0,0,'Y',TO_DATE('2016-01-12 10:29:17','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:29:17','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','U','9eae7aa7-cf87-4dc7-b00c-b00ec8a6c18b','Y',30,5) +; + +-- Jan 12, 2016 10:29:18 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (204113,'Tree','Identifies a Tree','The Tree field identifies a unique Tree in the system. Trees define roll ups or summary levels of information. They are used in reports for defining report points and summarization levels.',200209,6212,'Y',22,40,'N','N','N','N',0,0,'Y',TO_DATE('2016-01-12 10:29:18','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:29:18','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','62d8ad00-5561-4acb-9cca-4da54c032efc','Y',40,2) +; + +-- Jan 12, 2016 10:29:19 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (204114,'Node',200209,6213,'Y',22,50,'N','N','N','N',0,0,'Y',TO_DATE('2016-01-12 10:29:18','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:29:18','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','b4e6196a-f267-436f-b0a3-fdbd7e1dcba5','Y',50,2) +; + +-- Jan 12, 2016 10:29:19 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (204115,'User/Contact','User within the system - Internal or Business Partner Contact','The User identifies a unique user in the system. This could be an internal user or a business partner contact',200209,6214,'Y',22,60,'N','N','N','N',0,0,'Y',TO_DATE('2016-01-12 10:29:19','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:29:19','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','ba68215d-7892-4dc8-99e6-be917d88e551','Y',60,2) +; + +-- Jan 12, 2016 10:29:20 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,ColumnSpan) VALUES (204116,'AD_TreeBar_UU',200209,60515,'N',36,'N','N','N','N',0,0,'Y',TO_DATE('2016-01-12 10:29:19','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:29:19','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','faf67edd-1c7f-4f41-a90a-7d5aad242f95','N',2) +; + +-- Jan 12, 2016 10:29:20 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (204117,'Favourite','This record is a favourite',200209,212587,'Y',1,70,'N','N','N','N',0,0,'Y',TO_DATE('2016-01-12 10:29:20','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:29:20','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','87f06de6-7c31-4342-9c9a-8f7884362608','Y',70,2,2) +; + +-- Jan 12, 2016 10:29:20 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (204118,'Login automatic open sequence','Determine the order items will be automatically opened when user logs in',200209,212588,'Y',10,80,'N','N','N','N',0,0,'Y',TO_DATE('2016-01-12 10:29:20','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:29:20','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','1b3476cb-954d-4cc4-8eaf-b7c8cb2d084b','Y',80,2) +; + +-- Jan 12, 2016 10:29:21 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (204119,'Active','The record is active in the system','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.',200209,6207,'Y',1,90,'N','N','N','N',0,0,'Y',TO_DATE('2016-01-12 10:29:20','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:29:20','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','741ce933-585b-4ff0-aac0-a8090f9bf61d','Y',90,2,2) +; + +-- Jan 12, 2016 10:29:44 AM CET +UPDATE AD_Field SET SeqNoGrid=30,IsDisplayedGrid='Y' WHERE AD_Field_ID=204113 +; + +-- Jan 12, 2016 10:29:44 AM CET +UPDATE AD_Field SET SeqNoGrid=40,IsDisplayedGrid='Y' WHERE AD_Field_ID=204115 +; + +-- Jan 12, 2016 10:29:44 AM CET +UPDATE AD_Field SET SeqNoGrid=60,IsDisplayedGrid='Y' WHERE AD_Field_ID=204112 +; + +-- Jan 12, 2016 10:35:49 AM CET +INSERT INTO AD_Menu (AD_Menu_ID,Name,Action,AD_Window_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsSummary,IsSOTrx,IsReadOnly,EntityType,IsCentrallyMaintained,AD_Menu_UU) VALUES (200137,'Menu favourites','W',200083,0,0,'Y',TO_DATE('2016-01-12 10:35:48','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-01-12 10:35:48','YYYY-MM-DD HH24:MI:SS'),100,'N','N','N','D','Y','4c077852-7b04-4107-a383-f3273363dbf5') +; + +-- Jan 12, 2016 10:35:49 AM CET +INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNodeMM_UU) SELECT t.AD_Client_ID, 0, 'Y', SysDate, 100, SysDate, 100,t.AD_Tree_ID, 200137, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200137) +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=334 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=498 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=224 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=145 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=336 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=341 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=144 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=170 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=465 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200137 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=101 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=294 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=12, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=395 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=13, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=296 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=14, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=221 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=15, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=233 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=16, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=290 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=17, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=109 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=18, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200093 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=19, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=50008 +; + +SELECT register_migration_script('201609091030_IDEMPIERE-3000.sql') FROM dual +; diff --git a/migration/i3.1/postgresql/201609091030_IDEMPIERE-3000.sql b/migration/i3.1/postgresql/201609091030_IDEMPIERE-3000.sql new file mode 100644 index 0000000000..1bac257a60 --- /dev/null +++ b/migration/i3.1/postgresql/201609091030_IDEMPIERE-3000.sql @@ -0,0 +1,232 @@ +-- IDEMPIERE-3000 +-- Jan 12, 2016 10:23:45 AM CET +INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,PrintName,EntityType,AD_Element_UU) VALUES (202958,0,0,'Y',TO_TIMESTAMP('2016-01-12 10:23:44','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:23:44','YYYY-MM-DD HH24:MI:SS'),100,'IsFavourite','Favourite','This record is a favourite','Favourite','U','0a31aa8d-9aad-48b2-855c-746f80b9f261') +; + +-- Jan 12, 2016 10:23:50 AM CET +UPDATE AD_Element SET EntityType='D',Updated=TO_TIMESTAMP('2016-01-12 10:23:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=202958 +; + +-- Jan 12, 2016 10:24:57 AM CET +INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,PrintName,EntityType,AD_Element_UU) VALUES (202959,0,0,'Y',TO_TIMESTAMP('2016-01-12 10:24:57','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:24:57','YYYY-MM-DD HH24:MI:SS'),100,'LoginOpenSeqNo','Login automatic open sequence','Determine the order items will be automatically opened when user logs in','Login automatic open sequence','D','4f45e332-f582-45ef-be7e-35f970fb3f74') +; + +-- Jan 12, 2016 10:25:30 AM CET +UPDATE AD_Column SET AD_Val_Rule_ID=150, IsUpdateable='N',Updated=TO_TIMESTAMP('2016-01-12 10:25:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=6212 +; + +-- Jan 12, 2016 10:26:05 AM CET +INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (212587,0,'Favourite','This record is a favourite',456,'IsFavourite','Y',1,'N','N','Y','N','N',0,'N',20,0,0,'Y',TO_TIMESTAMP('2016-01-12 10:26:04','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:26:04','YYYY-MM-DD HH24:MI:SS'),100,202958,'Y','N','U','N','N','N','Y','05a76d6a-3357-4ad7-b594-43652f111d49','Y',0,'N','N') +; + +-- Jan 12, 2016 10:26:06 AM CET +ALTER TABLE AD_TreeBar ADD COLUMN IsFavourite CHAR(1) DEFAULT 'Y' CHECK (IsFavourite IN ('Y','N')) NOT NULL +; + +-- Jan 12, 2016 10:26:09 AM CET +INSERT INTO t_alter_column values('ad_treebar','IsFavourite','CHAR(1)',null,'Y') +; + +-- Jan 12, 2016 10:26:09 AM CET +UPDATE AD_TreeBar SET IsFavourite='Y' WHERE IsFavourite IS NULL +; + +-- Jan 12, 2016 10:26:25 AM CET +INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (212588,0,'Login automatic open sequence','Determine the order items will be automatically opened when user logs in',456,'LoginOpenSeqNo',10,'N','N','N','N','N',0,'N',11,0,0,'Y',TO_TIMESTAMP('2016-01-12 10:26:25','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:26:25','YYYY-MM-DD HH24:MI:SS'),100,202959,'Y','N','U','N','N','N','Y','c0e29ca1-f92d-48aa-bd6b-b4d6ffb56ad5','Y',0,'N','N') +; + +-- Jan 12, 2016 10:26:25 AM CET +ALTER TABLE AD_TreeBar ADD COLUMN LoginOpenSeqNo NUMERIC(10) DEFAULT NULL +; + +-- Jan 12, 2016 10:26:38 AM CET +INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,ColumnSQL,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (212589,0,'Name','Alphanumeric identifier of the entity','The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.',456,'Name',60,'N','N','N','N','Y',0,'N',10,0,0,'Y',TO_TIMESTAMP('2016-01-12 10:26:38','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:26:38','YYYY-MM-DD HH24:MI:SS'),100,469,'N','Y','U','N','N','(SELECT Name FROM AD_Menu WHERE AD_Menu_ID = AD_TreeBar.Node_ID)','N','Y','b9dd089d-3bdf-4140-a9bf-9801221cbb58','N',0,'N','N') +; + +-- Jan 12, 2016 10:26:54 AM CET +UPDATE AD_Column SET IsUpdateable='N', IsSelectionColumn='Y', SeqNoSelection=1,Updated=TO_TIMESTAMP('2016-01-12 10:26:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=6212 +; + +-- Jan 12, 2016 10:26:58 AM CET +UPDATE AD_Column SET IsUpdateable='N', IsSelectionColumn='Y', SeqNoSelection=2,Updated=TO_TIMESTAMP('2016-01-12 10:26:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=6214 +; + +-- Jan 12, 2016 10:27:03 AM CET +UPDATE AD_Column SET SeqNoSelection=3,Updated=TO_TIMESTAMP('2016-01-12 10:27:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212589 +; + +-- Jan 12, 2016 10:27:19 AM CET +INSERT INTO AD_Window (AD_Window_ID,Name,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,WindowType,Processing,EntityType,IsSOTrx,IsDefault,WinHeight,WinWidth,IsBetaFunctionality,AD_Window_UU) VALUES (200083,'Menu favourites',0,0,'Y',TO_TIMESTAMP('2016-01-12 10:27:18','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:27:18','YYYY-MM-DD HH24:MI:SS'),100,'M','N','D','Y','N',0,0,'N','6cc7d70f-6937-4dd0-bb29-1ae097e0e0c1') +; + +-- Jan 12, 2016 10:27:27 AM CET +UPDATE AD_Table SET AD_Window_ID=200083,Updated=TO_TIMESTAMP('2016-01-12 10:27:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=456 +; + +-- Jan 12, 2016 10:27:51 AM CET +UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2016-01-12 10:27:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212587 +; + +-- Jan 12, 2016 10:27:58 AM CET +UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2016-01-12 10:27:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212588 +; + +-- Jan 12, 2016 10:28:03 AM CET +UPDATE AD_Table SET IsHighVolume='Y',Updated=TO_TIMESTAMP('2016-01-12 10:28:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=456 +; + +-- Jan 12, 2016 10:29:03 AM CET +INSERT INTO AD_Tab (AD_Tab_ID,Name,Description,AD_Window_ID,SeqNo,IsSingleRow,AD_Table_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,HasTree,IsInfoTab,IsTranslationTab,IsReadOnly,Processing,ImportFields,TabLevel,IsSortTab,EntityType,IsInsertRecord,IsAdvancedTab,AD_Tab_UU,TreeDisplayedOn) VALUES (200209,'Menu entries','In this tab, you''ll be able to manage favourites and entries which will open automatically on login',200083,10,'N',456,0,0,'Y',TO_TIMESTAMP('2016-01-12 10:29:03','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:29:03','YYYY-MM-DD HH24:MI:SS'),100,'N','N','N','N','N','N',0,'N','U','Y','N','aca32c5d-0142-42f5-809a-770e152efa85','B') +; + +-- Jan 12, 2016 10:29:13 AM CET +UPDATE AD_Tab SET EntityType='D',Updated=TO_TIMESTAMP('2016-01-12 10:29:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200209 +; + +-- Jan 12, 2016 10:29:17 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (204110,'Client','Client/Tenant for this installation.','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.',200209,6205,'Y',22,10,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2016-01-12 10:29:16','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:29:16','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','0740e23c-ec14-40b7-a389-56cee8660550','Y',10,2) +; + +-- Jan 12, 2016 10:29:17 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsAllowCopy,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (204111,'Organization','Organizational entity within client','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.',200209,6206,'Y',22,20,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2016-01-12 10:29:17','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:29:17','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','5c0062ec-c924-4ef1-871f-f6e184696c2a','Y','Y',20,4,2) +; + +-- Jan 12, 2016 10:29:18 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (204112,'Name','Alphanumeric identifier of the entity','The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.',200209,212589,'Y',60,30,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2016-01-12 10:29:17','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:29:17','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','U','9eae7aa7-cf87-4dc7-b00c-b00ec8a6c18b','Y',30,5) +; + +-- Jan 12, 2016 10:29:18 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (204113,'Tree','Identifies a Tree','The Tree field identifies a unique Tree in the system. Trees define roll ups or summary levels of information. They are used in reports for defining report points and summarization levels.',200209,6212,'Y',22,40,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2016-01-12 10:29:18','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:29:18','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','62d8ad00-5561-4acb-9cca-4da54c032efc','Y',40,2) +; + +-- Jan 12, 2016 10:29:19 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (204114,'Node',200209,6213,'Y',22,50,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2016-01-12 10:29:18','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:29:18','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','b4e6196a-f267-436f-b0a3-fdbd7e1dcba5','Y',50,2) +; + +-- Jan 12, 2016 10:29:19 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (204115,'User/Contact','User within the system - Internal or Business Partner Contact','The User identifies a unique user in the system. This could be an internal user or a business partner contact',200209,6214,'Y',22,60,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2016-01-12 10:29:19','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:29:19','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','ba68215d-7892-4dc8-99e6-be917d88e551','Y',60,2) +; + +-- Jan 12, 2016 10:29:20 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,ColumnSpan) VALUES (204116,'AD_TreeBar_UU',200209,60515,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2016-01-12 10:29:19','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:29:19','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','faf67edd-1c7f-4f41-a90a-7d5aad242f95','N',2) +; + +-- Jan 12, 2016 10:29:20 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (204117,'Favourite','This record is a favourite',200209,212587,'Y',1,70,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2016-01-12 10:29:20','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:29:20','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','87f06de6-7c31-4342-9c9a-8f7884362608','Y',70,2,2) +; + +-- Jan 12, 2016 10:29:20 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (204118,'Login automatic open sequence','Determine the order items will be automatically opened when user logs in',200209,212588,'Y',10,80,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2016-01-12 10:29:20','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:29:20','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','1b3476cb-954d-4cc4-8eaf-b7c8cb2d084b','Y',80,2) +; + +-- Jan 12, 2016 10:29:21 AM CET +INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (204119,'Active','The record is active in the system','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.',200209,6207,'Y',1,90,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2016-01-12 10:29:20','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:29:20','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','741ce933-585b-4ff0-aac0-a8090f9bf61d','Y',90,2,2) +; + +-- Jan 12, 2016 10:29:44 AM CET +UPDATE AD_Field SET SeqNoGrid=30,IsDisplayedGrid='Y' WHERE AD_Field_ID=204113 +; + +-- Jan 12, 2016 10:29:44 AM CET +UPDATE AD_Field SET SeqNoGrid=40,IsDisplayedGrid='Y' WHERE AD_Field_ID=204115 +; + +-- Jan 12, 2016 10:29:44 AM CET +UPDATE AD_Field SET SeqNoGrid=60,IsDisplayedGrid='Y' WHERE AD_Field_ID=204112 +; + +-- Jan 12, 2016 10:35:49 AM CET +INSERT INTO AD_Menu (AD_Menu_ID,Name,"action",AD_Window_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsSummary,IsSOTrx,IsReadOnly,EntityType,IsCentrallyMaintained,AD_Menu_UU) VALUES (200137,'Menu favourites','W',200083,0,0,'Y',TO_TIMESTAMP('2016-01-12 10:35:48','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-01-12 10:35:48','YYYY-MM-DD HH24:MI:SS'),100,'N','N','N','D','Y','4c077852-7b04-4107-a383-f3273363dbf5') +; + +-- Jan 12, 2016 10:35:49 AM CET +INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNodeMM_UU) SELECT t.AD_Client_ID, 0, 'Y', statement_timestamp(), 100, statement_timestamp(), 100,t.AD_Tree_ID, 200137, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200137) +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=0, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=334 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=1, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=498 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=2, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=224 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=3, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=145 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=4, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=336 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=5, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=341 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=6, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=144 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=7, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=170 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=8, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=465 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=9, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=200137 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=10, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=101 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=11, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=294 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=12, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=395 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=13, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=296 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=14, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=221 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=15, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=233 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=16, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=290 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=17, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=109 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=18, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=200093 +; + +-- Jan 12, 2016 10:36:19 AM CET +UPDATE AD_TreeNodeMM SET Parent_ID=161, SeqNo=19, Updated=statement_timestamp() WHERE AD_Tree_ID=10 AND Node_ID=50008 +; + + + +SELECT register_migration_script('201609091030_IDEMPIERE-3000.sql') FROM dual +; diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_TreeBar.java b/org.adempiere.base/src/org/compiere/model/I_AD_TreeBar.java index 92f41010f3..8297670250 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_TreeBar.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_TreeBar.java @@ -130,6 +130,45 @@ public interface I_AD_TreeBar */ public boolean isActive(); + /** Column name IsFavourite */ + public static final String COLUMNNAME_IsFavourite = "IsFavourite"; + + /** Set Favourite. + * This record is a favourite + */ + public void setIsFavourite (boolean IsFavourite); + + /** Get Favourite. + * This record is a favourite + */ + public boolean isFavourite(); + + /** Column name LoginOpenSeqNo */ + public static final String COLUMNNAME_LoginOpenSeqNo = "LoginOpenSeqNo"; + + /** Set Login automatic open sequence. + * Determine the order items will be automatically opened when user logs in + */ + public void setLoginOpenSeqNo (int LoginOpenSeqNo); + + /** Get Login automatic open sequence. + * Determine the order items will be automatically opened when user logs in + */ + public int getLoginOpenSeqNo(); + + /** Column name Name */ + public static final String COLUMNNAME_Name = "Name"; + + /** Set Name. + * Alphanumeric identifier of the entity + */ + public void setName (String Name); + + /** Get Name. + * Alphanumeric identifier of the entity + */ + public String getName(); + /** Column name Node_ID */ public static final String COLUMNNAME_Node_ID = "Node_ID"; diff --git a/org.adempiere.base/src/org/compiere/model/MTree.java b/org.adempiere.base/src/org/compiere/model/MTree.java index 92e742cdc6..f24f2d8f5f 100644 --- a/org.adempiere.base/src/org/compiere/model/MTree.java +++ b/org.adempiere.base/src/org/compiere/model/MTree.java @@ -44,12 +44,12 @@ import org.compiere.util.Env; */ public class MTree extends MTree_Base { + /** * */ private static final long serialVersionUID = -6412057411585787707L; - /** * Default Constructor. * Need to call loadNodes explicitly @@ -229,7 +229,7 @@ public class MTree extends MTree_Base + "tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive " + "FROM ").append(getNodeTableName()).append(" tn" + " LEFT OUTER JOIN AD_TreeBar tb ON (tn.AD_Tree_ID=tb.AD_Tree_ID" - + " AND tn.Node_ID=tb.Node_ID " + + " AND tn.Node_ID=tb.Node_ID AND tb.IsFavourite = 'Y'" + (AD_User_ID != -1 ? " AND tb.AD_User_ID=? ": "") // #1 (conditional) + ") " + "WHERE tn.AD_Tree_ID=?"); // #2 diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_TreeBar.java b/org.adempiere.base/src/org/compiere/model/X_AD_TreeBar.java index 58e6885f99..dc6c6a1d78 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_TreeBar.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_TreeBar.java @@ -30,7 +30,7 @@ public class X_AD_TreeBar extends PO implements I_AD_TreeBar, I_Persistent /** * */ - private static final long serialVersionUID = 20151030L; + private static final long serialVersionUID = 20160112L; /** Standard Constructor */ public X_AD_TreeBar (Properties ctx, int AD_TreeBar_ID, String trxName) @@ -40,6 +40,8 @@ public class X_AD_TreeBar extends PO implements I_AD_TreeBar, I_Persistent { setAD_Tree_ID (0); setAD_User_ID (0); + setIsFavourite (true); +// Y setNode_ID (0); } */ } @@ -142,6 +144,66 @@ public class X_AD_TreeBar extends PO implements I_AD_TreeBar, I_Persistent return ii.intValue(); } + /** Set Favourite. + @param IsFavourite + This record is a favourite + */ + public void setIsFavourite (boolean IsFavourite) + { + set_Value (COLUMNNAME_IsFavourite, Boolean.valueOf(IsFavourite)); + } + + /** Get Favourite. + @return This record is a favourite + */ + public boolean isFavourite () + { + Object oo = get_Value(COLUMNNAME_IsFavourite); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Login automatic open sequence. + @param LoginOpenSeqNo + Determine the order items will be automatically opened when user logs in + */ + public void setLoginOpenSeqNo (int LoginOpenSeqNo) + { + set_Value (COLUMNNAME_LoginOpenSeqNo, Integer.valueOf(LoginOpenSeqNo)); + } + + /** Get Login automatic open sequence. + @return Determine the order items will be automatically opened when user logs in + */ + public int getLoginOpenSeqNo () + { + Integer ii = (Integer)get_Value(COLUMNNAME_LoginOpenSeqNo); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Name. + @param Name + Alphanumeric identifier of the entity + */ + public void setName (String Name) + { + throw new IllegalArgumentException ("Name is virtual column"); } + + /** Get Name. + @return Alphanumeric identifier of the entity + */ + public String getName () + { + return (String)get_Value(COLUMNNAME_Name); + } + /** Set Node. @param Node_ID Node */ public void setNode_ID (int Node_ID) diff --git a/org.adempiere.server-feature/server.product.launch b/org.adempiere.server-feature/server.product.launch index 530fe8f959..470dcecff9 100644 --- a/org.adempiere.server-feature/server.product.launch +++ b/org.adempiere.server-feature/server.product.launch @@ -19,7 +19,7 @@ - + diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java index 79e241a550..02efbb3d15 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java @@ -17,8 +17,12 @@ package org.adempiere.webui; +import static org.compiere.model.SystemIDs.TREE_MENUPRIMARY; + import java.lang.ref.WeakReference; +import java.math.BigDecimal; import java.util.HashMap; +import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Properties; @@ -41,6 +45,7 @@ import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.util.BrowserToken; import org.adempiere.webui.util.UserPreference; +import org.compiere.model.MMenu; import org.compiere.model.MRole; import org.compiere.model.MSession; import org.compiere.model.MSysConfig; @@ -49,6 +54,7 @@ import org.compiere.model.MTable; import org.compiere.model.MUser; import org.compiere.model.MUserPreference; import org.compiere.util.CLogger; +import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Language; import org.compiere.util.Msg; @@ -79,10 +85,11 @@ import org.zkoss.zul.Window; */ public class AdempiereWebUI extends Window implements EventListener, IWebClient { + /** * */ - private static final long serialVersionUID = 2030098494203345181L; + private static final long serialVersionUID = -3320656546509525766L; private static final String SAVED_CONTEXT = "saved.context"; @@ -283,6 +290,7 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb Env.setContext(ctx, "#LocalHttpAddr", localHttpAddr.toString()); Clients.response(new AuScript("zAu.cmd0.clearBusy()")); + automaticOpen(); processParameters(); } @@ -542,4 +550,69 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb } return uploadSetting.toString(); } + + int getMenuID() + { + int AD_Role_ID = Env.getAD_Role_ID(Env.getCtx()); + int AD_Tree_ID = DB.getSQLValue(null, + "SELECT COALESCE(r.AD_Tree_Menu_ID, ci.AD_Tree_Menu_ID)" + + "FROM AD_ClientInfo ci" + + " INNER JOIN AD_Role r ON (ci.AD_Client_ID=r.AD_Client_ID) " + + "WHERE AD_Role_ID=?", AD_Role_ID); + if (AD_Tree_ID <= 0) + AD_Tree_ID = TREE_MENUPRIMARY; // Menu + + return AD_Tree_ID; + } + + private void automaticOpen() { + + 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") + .append(" INNER JOIN AD_Menu m ON (tb.Node_ID = m.AD_Menu_ID)") + .append(" WHERE tb.AD_Tree_ID = ").append(getMenuID()) + .append(" AND tb.AD_User_ID = ").append(Env.getAD_User_ID(Env.getCtx())) + .append(" AND tb.IsActive = 'Y' AND tb.LoginOpenSeqNo > 0") + .append(" ORDER BY tb.LoginOpenSeqNo"); + + List> rows = DB.getSQLArrayObjectsEx(null, sql.toString()); + if (rows != null && rows.size() > 0) { + for (List row : rows) { + + String action = (String) row.get(0); + int recordID = ((BigDecimal) row.get(1)).intValue(); + + if (action.equals(MMenu.ACTION_Form)) { + Boolean access = MRole.getDefault().getFormAccess(recordID); + if (access != null && access) + SessionManager.getAppDesktop().openForm(recordID); + } + else if (action.equals(MMenu.ACTION_Info)) { + Boolean access = MRole.getDefault().getInfoAccess(recordID); + if (access != null && access) + SessionManager.getAppDesktop().openInfo(recordID); + } + else if (action.equals(MMenu.ACTION_Process) || action.equals(MMenu.ACTION_Report)) { + Boolean access = MRole.getDefault().getProcessAccess(recordID); + if (access != null && access) + SessionManager.getAppDesktop().openProcessDialog(recordID, DB.getSQLValueStringEx(null, "SELECT IsSOTrx FROM AD_Menu WHERE AD_Menu_ID = ?", recordID).equals("Y")); + } + else if (action.equals(MMenu.ACTION_Task)) { + Boolean access = MRole.getDefault().getTaskAccess(recordID); + if (access != null && access) + SessionManager.getAppDesktop().openTask(recordID); + } + else if (action.equals(MMenu.ACTION_Window)) { + Boolean access = MRole.getDefault().getWindowAccess(recordID); + if (access != null && access) + SessionManager.getAppDesktop().openWindow(recordID, null); + } + else if (action.equals(MMenu.ACTION_WorkFlow)) { + Boolean access = MRole.getDefault().getWorkflowAccess(recordID); + if (access != null && access) + SessionManager.getAppDesktop().openWorkflow(recordID); + } + } + } + } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java index d5bba7f3fd..6016896d59 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java @@ -58,12 +58,13 @@ import org.zkoss.zul.Vbox; */ public class DPFavourites extends DashboardPanel implements EventListener { - private static final String NODE_ID_ATTR = "Node_ID"; - /** * */ - private static final long serialVersionUID = -481859785800845108L; + private static final long serialVersionUID = 8398216266900311289L; + + private static final String NODE_ID_ATTR = "Node_ID"; + public static final String FAVOURITE_DROPPABLE = "favourite"; @@ -180,19 +181,36 @@ public class DPFavourites extends DashboardPanel implements EventListener int AD_Org_ID = Env.getContextAsInt(Env.getCtx(), "#AD_Org_ID"); int AD_User_ID = Env.getContextAsInt(Env.getCtx(), "#AD_User_ID"); StringBuilder sql = new StringBuilder(); - if (add) - sql.append("INSERT INTO AD_TreeBar " - + "(AD_Tree_ID,AD_User_ID,Node_ID, " - + "AD_Client_ID,AD_Org_ID, " - + "IsActive,Created,CreatedBy,Updated,UpdatedBy)VALUES (") - .append(m_AD_Tree_ID).append(",").append(AD_User_ID).append(",").append(Node_ID).append(",") - .append(AD_Client_ID).append(",").append(AD_Org_ID).append(",") - .append("'Y',SysDate,").append(AD_User_ID).append(",SysDate,").append(AD_User_ID).append(")"); - // if already exist, will result in ORA-00001: unique constraint (ADEMPIERE.AD_TREEBAR_KEY) - else - sql.append("DELETE AD_TreeBar WHERE AD_Tree_ID=").append(m_AD_Tree_ID) + if (add) { + // If record already exist, we will only make an update + if (DB.getSQLValueEx(null, "SELECT 1 FROM AD_TreeBar WHERE AD_Tree_ID = ? AND AD_User_ID = ? AND Node_ID = ?", m_AD_Tree_ID, AD_User_ID, Node_ID) == 1) { + sql.append("UPDATE AD_TreeBar SET IsFavourite = 'Y', Updated = Sysdate, UpdatedBy = ").append(AD_User_ID).append(" WHERE AD_Tree_ID = ").append(m_AD_Tree_ID) .append(" AND AD_User_ID=").append(AD_User_ID) .append(" AND Node_ID=").append(Node_ID); + } + else // we will create the record + sql.append("INSERT INTO AD_TreeBar " + + "(AD_Tree_ID,AD_User_ID,Node_ID, " + + "AD_Client_ID,AD_Org_ID, " + + "IsActive,Created,CreatedBy,Updated,UpdatedBy)VALUES (") + .append(m_AD_Tree_ID).append(",").append(AD_User_ID).append(",").append(Node_ID).append(",") + .append(AD_Client_ID).append(",").append(AD_Org_ID).append(",") + .append("'Y',SysDate,").append(AD_User_ID).append(",SysDate,").append(AD_User_ID).append(")"); + // if already exist, will result in ORA-00001: unique constraint (ADEMPIERE.AD_TREEBAR_KEY) + } + else { + // if the menu entry is opened at login, we will only remove it from favourites + if (DB.getSQLValueEx(null, "SELECT LoginOpenSeqNo FROM AD_TreeBar WHERE AD_Tree_ID = ? AND AD_User_ID = ? AND Node_ID = ?", m_AD_Tree_ID, AD_User_ID, Node_ID) > 0) { + + sql.append("UPDATE AD_TreeBar SET IsFavourite = 'N', Updated = Sysdate, UpdatedBy = ").append(AD_User_ID).append(" WHERE AD_Tree_ID = ").append(m_AD_Tree_ID) + .append(" AND AD_User_ID=").append(AD_User_ID) + .append(" AND Node_ID=").append(Node_ID); + } + else // otherwise, we remove the record + sql.append("DELETE AD_TreeBar WHERE AD_Tree_ID=").append(m_AD_Tree_ID) + .append(" AND AD_User_ID=").append(AD_User_ID) + .append(" AND Node_ID=").append(Node_ID); + } int no = DB.executeUpdate(sql.toString(), false, null); return no == 1; } From 23cfb0493e5f20133f40e0a91ef4ea57af81208b Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 9 Sep 2016 15:19:46 +0200 Subject: [PATCH 02/16] IDEMPIERE-3000 Automatic opening of menu entries at login / revert change to server.product.launch committed by mistake in 48bf3c1bf075 --- org.adempiere.server-feature/server.product.launch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/org.adempiere.server-feature/server.product.launch b/org.adempiere.server-feature/server.product.launch index 470dcecff9..e47fef68ac 100644 --- a/org.adempiere.server-feature/server.product.launch +++ b/org.adempiere.server-feature/server.product.launch @@ -16,16 +16,16 @@ - + - + - - + + From d3efa64d9a4b845de173aaa33b48e6c29ec7e3f6 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 9 Sep 2016 15:33:20 +0200 Subject: [PATCH 03/16] IDEMPIERE-3000 commit new version of server.product.launch - restored wrong from experimental --- org.adempiere.server-feature/server.product.launch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/org.adempiere.server-feature/server.product.launch b/org.adempiere.server-feature/server.product.launch index e47fef68ac..c636044aff 100644 --- a/org.adempiere.server-feature/server.product.launch +++ b/org.adempiere.server-feature/server.product.launch @@ -16,16 +16,16 @@ - + - + - - + + From 35933b6ce2621ea01a4caf1f9fc7ffd798cc9c29 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 9 Sep 2016 16:19:36 +0200 Subject: [PATCH 04/16] IDEMPIERE-3001 CalloutInventory.product: can't fill asi after save physical inventory line also don't update Quantity book --- .../org/compiere/model/CalloutInventory.java | 38 +++---------------- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutInventory.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutInventory.java index 8876280d36..9e6d034539 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutInventory.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutInventory.java @@ -58,39 +58,12 @@ public class CalloutInventory extends CalloutEngine docSubTypeInv = dt.getDocSubTypeInv(); } - Integer InventoryLine = (Integer)mTab.getValue("M_InventoryLine_ID"); - BigDecimal bd = null; - - if (InventoryLine != null && InventoryLine.intValue() != 0) { - MInventoryLine _ILine = new MInventoryLine(ctx, InventoryLine, null); - Integer M_Product_ID = (Integer)mTab.getValue("M_Product_ID"); - Integer M_Locator_ID = (Integer)mTab.getValue("M_Locator_ID"); - Integer M_AttributeSetInstance_ID = 0; - // if product or locator has changed recalculate Book Qty - if ((M_Product_ID != null && M_Product_ID != _ILine.getM_Product_ID()) || - (M_Locator_ID !=null && M_Locator_ID != _ILine.getM_Locator_ID())) { - - // Check ASI - if product has been changed remove old ASI - if (M_Product_ID == _ILine.getM_Product_ID()) { - M_AttributeSetInstance_ID = (Integer)mTab.getValue("M_AttributeSetInstance_ID"); - if( M_AttributeSetInstance_ID == null ) - M_AttributeSetInstance_ID = 0; - } else { - mTab.setValue("M_AttributeSetInstance_ID", null); - } - if (MDocType.DOCSUBTYPEINV_PhysicalInventory.equals(docSubTypeInv)) { - try { - bd = setQtyBook(M_AttributeSetInstance_ID, M_Product_ID, M_Locator_ID); - mTab.setValue("QtyBook", bd); - } catch (Exception e) { - return e.getLocalizedMessage(); - } - } - } - return ""; + if ("M_Product_ID".equals(mField.getColumnName())) { + // product changed - remove old ASI + mTab.setValue("M_AttributeSetInstance_ID", null); } - - // New Line - Get Book Value + + // Get Book Value int M_Product_ID = 0; Integer Product = (Integer)mTab.getValue("M_Product_ID"); if (Product != null) @@ -128,6 +101,7 @@ public class CalloutInventory extends CalloutEngine // Set QtyBook from first storage location // kviiksaar: Call's now the extracted function + BigDecimal bd = null; if (MDocType.DOCSUBTYPEINV_PhysicalInventory.equals(docSubTypeInv)) { try { bd = setQtyBook(M_AttributeSetInstance_ID, M_Product_ID, M_Locator_ID); From 5b29241d87f795868d5f43475011e311eb13a9c8 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 12 Sep 2016 18:06:07 +0800 Subject: [PATCH 05/16] IDEMPIERE-3155 Posting issue in Matching PO-Receipt-Invoice. Fix posting for un-matching of Receipt and Invoice. --- .../src/org/compiere/acct/Doc_MatchInv.java | 13 ++++++++++--- .../src/org/compiere/acct/FactLine.java | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java b/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java index 18907d884a..eb47d489ef 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java @@ -191,9 +191,12 @@ public class Doc_MatchInv extends Doc } else { + BigDecimal effMultiplier = multiplier; + if (getQty().signum() < 0) + effMultiplier = effMultiplier.negate(); if (!dr.updateReverseLine (MInOut.Table_ID, // Amt updated m_receiptLine.getM_InOut_ID(), m_receiptLine.getM_InOutLine_ID(), - multiplier)) + effMultiplier)) { p_Error = "Mat.Receipt not posted yet"; return null; @@ -241,10 +244,14 @@ public class Doc_MatchInv extends Doc } else { - cr.setQty(getQty().negate()); + cr.setQty(getQty().negate()); + BigDecimal effMultiplier = multiplier; + if (getQty().signum() < 0) + effMultiplier = effMultiplier.negate(); + // Set AmtAcctCr/Dr from Invoice (sets also Project) if (!cr.updateReverseLine (MInvoice.Table_ID, // Amt updated - m_invoiceLine.getC_Invoice_ID(), m_invoiceLine.getC_InvoiceLine_ID(), multiplier)) + m_invoiceLine.getC_Invoice_ID(), m_invoiceLine.getC_InvoiceLine_ID(), effMultiplier)) { p_Error = "Invoice not posted yet"; return null; diff --git a/org.adempiere.base/src/org/compiere/acct/FactLine.java b/org.adempiere.base/src/org/compiere/acct/FactLine.java index 8dc64bd0b8..76890e035f 100644 --- a/org.adempiere.base/src/org/compiere/acct/FactLine.java +++ b/org.adempiere.base/src/org/compiere/acct/FactLine.java @@ -301,6 +301,25 @@ public final class FactLine extends X_Fact_Acct */ public void setAmtAcct(int C_Currency_ID, BigDecimal AmtAcctDr, BigDecimal AmtAcctCr) { + if (! m_acctSchema.isAllowNegativePosting()) { + // fix Debit & Credit + if (AmtAcctDr != null) + { + if (AmtAcctDr.compareTo(Env.ZERO) == -1) + { + AmtAcctCr = AmtAcctDr.abs(); + AmtAcctDr = Env.ZERO; + } + } + if (AmtAcctCr != null) + { + if (AmtAcctCr.compareTo(Env.ZERO) == -1) + { + AmtAcctDr = AmtAcctCr.abs(); + AmtAcctCr = Env.ZERO; + } + } + } setAmtAcctDr (AmtAcctDr); setAmtAcctCr (AmtAcctCr); // Currency Precision From 6a7b6807ced8b8991a9926f3ffe5305fe71d010c Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 12 Sep 2016 18:10:33 +0800 Subject: [PATCH 06/16] IDEMPIERE-3170 Return to Vendor propagate wrong cost amount to Organization accounting schema denoted in different currency --- .../src/org/compiere/acct/Doc_InOut.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java b/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java index 459d16e2bb..e9fb2fd1e8 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java @@ -24,6 +24,7 @@ import java.util.logging.Level; import org.compiere.model.I_M_InOutLine; import org.compiere.model.I_M_RMALine; +import org.compiere.model.MConversionRate; import org.compiere.model.MOrderLandedCostAllocation; import org.compiere.model.MTax; import org.compiere.model.MCurrency; @@ -624,6 +625,15 @@ public class Doc_InOut extends Doc costs = costs.subtract(costTax); } } // correct included Tax + + // different currency + if (C_Currency_ID != originalOrderLine.getC_Currency_ID()) + { + costs = MConversionRate.convert (getCtx(), + costs, originalOrderLine.getC_Currency_ID(), C_Currency_ID, + getDateAcct(), 0, getAD_Client_ID(), getAD_Org_ID(), true); + } + costs = costs.multiply(line.getQty()); costs = costs.negate(); } From 9485f855fd8a6c5295ff4e401bf5795c46a7b6a8 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 13 Sep 2016 23:32:59 +0200 Subject: [PATCH 07/16] IDEMPIERE-2977 Update tab name not always correct --- .../org/adempiere/webui/adwindow/AbstractADWindowContent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index 7f4ba69ee0..ec3fae95a8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -3261,7 +3261,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements Env.setContext(ctx, curWindowNo, "Value", ""); Env.setContext(ctx, curWindowNo, "Name", ""); } - + prevdbInfo = ""; } } From e20ad177dee904ea364db460ebfffdb5e06aa01d Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 21 Sep 2016 10:48:04 +0800 Subject: [PATCH 08/16] IDEMPIERE-3187 Matching PO-Receipt-Invoice doesn't displaying the Vendor Return-Document --- .../src/org/compiere/apps/form/Match.java | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/org.adempiere.ui/src/org/compiere/apps/form/Match.java b/org.adempiere.ui/src/org/compiere/apps/form/Match.java index 0147048172..1d4c7975b2 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/Match.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/Match.java @@ -113,7 +113,7 @@ public class Match else if (matchToString.equals(m_matchOptions[MATCH_ORDER])) matchToType = MATCH_ORDER; // - tableInit(display, matchToType, matched); // sets m_sql + tableInit(display, matchToType, matched,null); // sets m_sql // ** Add Where Clause ** // Product @@ -241,8 +241,11 @@ public class Match display = MATCH_SHIPMENT; else if (displayString.equals(m_matchOptions[MATCH_ORDER])) display = MATCH_ORDER; + + KeyNamePair lineMatched = (KeyNamePair)xMatchedTable.getValueAt(row, I_Line); + //int matchToType = matchFrom.getSelectedIndex(); - tableInit (display, matchToType, matched); // sets m_sql + tableInit (display, matchToType, matched, lineMatched); // sets m_sql // ** Add Where Clause ** KeyNamePair BPartner = (KeyNamePair)xMatchedTable.getValueAt(row, I_BPartner); //KeyNamePair Org = (KeyNamePair)xMatchedTable.getValueAt(row, I_Org); //JAVIER @@ -277,7 +280,7 @@ public class Match * @param display (Invoice, Shipment, Order) see MATCH_* * @param matchToType (Invoice, Shipment, Order) see MATCH_* */ - protected void tableInit (int display, int matchToType, boolean matched) + protected void tableInit (int display, int matchToType, boolean matched, KeyNamePair lineMatched) { //boolean matched = matchMode.getSelectedIndex() == MODE_MATCHED; if (log.isLoggable(Level.CONFIG)) log.config("Display=" + m_matchOptions[display] @@ -285,6 +288,11 @@ public class Match + ", Matched=" + matched); m_sql = new StringBuffer (); + int Line_ID = 0; + if (lineMatched != null ) + { + Line_ID = lineMatched.getKey(); + } if (display == MATCH_INVOICE) { m_dateColumn = "hdr.DateInvoiced"; @@ -300,6 +308,9 @@ public class Match + " INNER JOIN C_DocType dt ON (hdr.C_DocType_ID=dt.C_DocType_ID AND dt.DocBaseType IN ('API','APC'))" + " FULL JOIN M_MatchInv mi ON (lin.C_InvoiceLine_ID=mi.C_InvoiceLine_ID) " + "WHERE hdr.DocStatus IN ('CO','CL')"); + if (lineMatched!= null && Line_ID > 0 ) + m_sql.append(" AND mi.M_InOutLine_ID = ").append(Line_ID); + m_groupBy = " GROUP BY hdr.C_Invoice_ID,hdr.DocumentNo,hdr.DateInvoiced,bp.Name,hdr.C_BPartner_ID," + " lin.Line,lin.C_InvoiceLine_ID,p.Name,lin.M_Product_ID,lin.QtyInvoiced, org.Name, hdr.AD_Org_ID " //JAVIER + "HAVING " @@ -324,7 +335,9 @@ public class Match m_linetype = new StringBuffer(); m_linetype.append( matchToType == MATCH_SHIPMENT ? "M_InOutLine_ID" : "C_InvoiceLine_ID") ; if ( matched ) { - m_sql.append( " mo." + m_linetype + " IS NOT NULL " ) ; + m_sql.append( " mo." + m_linetype + " IS NOT NULL " ) ; + if (lineMatched!= null && Line_ID > 0 ) + m_sql.append( " AND mo.M_InOutLine_ID = " + Line_ID) ; } else { m_sql.append( " ( mo." + m_linetype + " IS NULL OR " + " (lin.QtyOrdered <> (SELECT sum(mo1.Qty) AS Qty" @@ -353,11 +366,16 @@ public class Match + " INNER JOIN C_BPartner bp ON (hdr.C_BPartner_ID=bp.C_BPartner_ID)" + " INNER JOIN M_InOutLine lin ON (hdr.M_InOut_ID=lin.M_InOut_ID)" + " INNER JOIN M_Product p ON (lin.M_Product_ID=p.M_Product_ID)" - + " INNER JOIN C_DocType dt ON (hdr.C_DocType_ID = dt.C_DocType_ID AND dt.DocBaseType='MMR')" + + " INNER JOIN C_DocType dt ON (hdr.C_DocType_ID = dt.C_DocType_ID AND (dt.DocBaseType='MMR' OR (dt.DocBaseType='MMS' AND hdr.isSOTrx ='N')))" + " FULL JOIN ") .append(matchToType == MATCH_ORDER ? "M_MatchPO" : "M_MatchInv") .append(" m ON (lin.M_InOutLine_ID=m.M_InOutLine_ID) " - + "WHERE hdr.DocStatus IN ('CO','CL')"); + + "WHERE hdr.DocStatus IN ('CO','CL')"); + if ( matchToType == MATCH_INVOICE && lineMatched!= null && Line_ID > 0 ) + m_sql.append(" AND m.C_InvoiceLine_ID = ").append(Line_ID); + if ( matchToType == MATCH_ORDER && lineMatched!= null && Line_ID > 0 ) + m_sql.append(" AND m.C_OrderLine_ID = ").append(Line_ID); + m_groupBy = " GROUP BY hdr.M_InOut_ID,hdr.DocumentNo,hdr.MovementDate,bp.Name,hdr.C_BPartner_ID," + " lin.Line,lin.M_InOutLine_ID,p.Name,lin.M_Product_ID,lin.MovementQty, org.Name, hdr.AD_Org_ID " //JAVIER + "HAVING " From abaf40515834f3bcee41ced0878300536de4626e Mon Sep 17 00:00:00 2001 From: hieplq Date: Tue, 13 Sep 2016 14:43:24 +0700 Subject: [PATCH 09/16] IDEMPIERE-3182:auto fill password don't work util you touch password field a complete solution. --- .../org/adempiere/webui/panel/LoginPanel.java | 2 -- org.adempiere.ui.zk/index.zul | 33 +++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java index dae2559759..f92dbecaeb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java @@ -174,8 +174,6 @@ public class LoginPanel extends Window implements EventListener } } onUserIdChange(AD_User_ID); - if (txtUserId.getValue().length() > 0) - txtPassword.focus(); chkRememberMe.setChecked(true); } if (MSystem.isZKRememberPasswordAllowed()) { diff --git a/org.adempiere.ui.zk/index.zul b/org.adempiere.ui.zk/index.zul index b58a14d7fd..d75c02b3ae 100644 --- a/org.adempiere.ui.zk/index.zul +++ b/org.adempiere.ui.zk/index.zul @@ -41,6 +41,7 @@ Copyright (C) 2007 Ashley G Ramdass. }); zk.afterLoad('zul.wgt', function () { + // should filter out for only component inside standard window or component wish fire this event, // or ever rise other event like start editting to distinguish with true onChange event zk.override(zul.inp.InputWidget.prototype, "doInput_", function (evt) { @@ -62,6 +63,38 @@ Copyright (C) 2007 Ashley G Ramdass. } }); + + zk.override(zk.Widget.prototype, "onAutofill", function (evt) { + id.zk.Extend.fakeOnchange (this);//fire change event to move to edit + }); + + zk.override(zul.inp.Textbox.prototype, "bind_", function (dt, skipper, after) { + if (!this.$bind_) + return; + + this.$bind_(dt, skipper, after); + + if (this.getType () != "password"){ + return; + } + + this.domListen_(this.$n(), "onChange", "onAutofill"); + }); + + + zk.override(zul.inp.Textbox.prototype, "unbind_", function (dt, skipper) { + if (!this.$unbind_) + return; + + this.$unbind_(dt, skipper); + + if (this.getType () != "password"){ + return; + } + + this.domUnlisten_(this.$n(), "onChange", "onAutofill"); //unlisten + }); + }); zk.afterLoad('zul.mesh', function () { From 0d0ce41a4b339241411310a30b3b4bbfe0a09505 Mon Sep 17 00:00:00 2001 From: hieplq Date: Sun, 4 Sep 2016 20:18:58 +0700 Subject: [PATCH 10/16] IDEMPIERE-3179:record should move to editing mode when user is editing first field a bit optimize. do nothing when component don't lay on standard window --- org.adempiere.ui.zk/index.zul | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/org.adempiere.ui.zk/index.zul b/org.adempiere.ui.zk/index.zul index d75c02b3ae..203bb5918e 100644 --- a/org.adempiere.ui.zk/index.zul +++ b/org.adempiere.ui.zk/index.zul @@ -46,13 +46,20 @@ Copyright (C) 2007 Ashley G Ramdass. // or ever rise other event like start editting to distinguish with true onChange event zk.override(zul.inp.InputWidget.prototype, "doInput_", function (evt) { this.$doInput_(evt); - var domElemOfLayout = jq('#' + this.$n().id).closest(".adwindow-layout"); - if (domElemOfLayout == null){ - ;// do nothing + + if (this.get ("isOnStardardWindow") == 'false'){ + return; // don't waste time to check component don't lay on standard window + } + + var domElemOfLayout = jq('#' + this.$n().id).closest(".adwindow-layout"); // return a array + if (domElemOfLayout.length == 0){ + this.set ("isOnStardardWindow", "false");// next time don't waste time to check this component + // in case, you move this component to a standard window, please update this properties at client by javascript Widget.set () + // or at server by java function component.setWidgetOverride }else{ var winLayoutWg = zk.Widget.$(domElemOfLayout); if (winLayoutWg == null){ - ;// do nothing + ;// do nothing, this case rare happen because ".adwindow-layout" always is a component }else{ var isEditting = winLayoutWg.get ("isEditting"); // winLayoutWg should cache to improve perfomance From 2f4199835403ef09fd8c6c71e50173a06b007e44 Mon Sep 17 00:00:00 2001 From: hieplq Date: Sun, 4 Sep 2016 21:38:49 +0700 Subject: [PATCH 11/16] IDEMPIERE-1287:When editing in a field (header or detail) use shortcut key (alt + next) to move next record. value in this field is not save --- .../WEB-INF/src/web/js/zkforge/KeyListener.js | 3 ++- org.adempiere.ui.zk/index.zul | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/web/js/zkforge/KeyListener.js b/org.adempiere.ui.zk/WEB-INF/src/web/js/zkforge/KeyListener.js index d51562a4e1..d8e9346bf3 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/web/js/zkforge/KeyListener.js +++ b/org.adempiere.ui.zk/WEB-INF/src/web/js/zkforge/KeyListener.js @@ -96,7 +96,8 @@ zkforge.KeyListener = zk.$extends(zul.Widget, { } evt.preventDefault(); - + // _autoBlur = true will let current focus control blur but this event is sent after key event, so haven't valuable + id.zk.Extend.fakeOnchange (zk.currentFocus); zAu.send(new zk.Event(zk.Widget.$(this), 'onCtrlKey', {keyCode: keycode, ctrlKey: evt.ctrlKey, shiftKey: evt.shiftKey, altKey: evt.altKey}, {toServer: true})); return false; diff --git a/org.adempiere.ui.zk/index.zul b/org.adempiere.ui.zk/index.zul index 203bb5918e..a3fd10f9d9 100644 --- a/org.adempiere.ui.zk/index.zul +++ b/org.adempiere.ui.zk/index.zul @@ -15,7 +15,17 @@ Copyright (C) 2007 Ashley G Ramdass. zk.afterLoad(function() { zk._Erbx.push = function(msg) { if (console) console.log(msg); - } + }; + + zk.$package('id.zk'); + + id.zk.Extend = zk.$extends(zk.Object, {}, { + fakeOnchange: function (wgt) { + // just sent fake event when control is textfield and value is not yet sync to server + if (wgt.$instanceof(zul.inp.Textbox) && wgt.$n().value != wgt.getText()) + zAu.send(new zk.Event(zk.Widget.$(wgt), 'onChange',{"value":wgt.$n().value})); + } + }); }); zk.afterLoad(function() { From 5adb11ed1c7bb6f01266e8d7c0686eda7752d49f Mon Sep 17 00:00:00 2001 From: hieplq Date: Sun, 4 Sep 2016 21:43:52 +0700 Subject: [PATCH 12/16] IDEMPIERE-3179:record should move to editing mode when user is editing first field a bit optimize and use common function --- org.adempiere.ui.zk/index.zul | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/index.zul b/org.adempiere.ui.zk/index.zul index a3fd10f9d9..5bd08e8210 100644 --- a/org.adempiere.ui.zk/index.zul +++ b/org.adempiere.ui.zk/index.zul @@ -74,7 +74,7 @@ Copyright (C) 2007 Ashley G Ramdass. var isEditting = winLayoutWg.get ("isEditting"); // winLayoutWg should cache to improve perfomance if (isEditting == "false"){ - zAu.send(new zk.Event(zk.Widget.$(this), 'onChange',{"value":this.$n().value}));//fire change event to move to edit + id.zk.Extend.fakeOnchange (this);//fire change event to move to edit } } } From ae3e0035608e1d575241efb024fdb25c754aa2d2 Mon Sep 17 00:00:00 2001 From: hieplq Date: Fri, 9 Sep 2016 22:08:22 +0700 Subject: [PATCH 13/16] IDEMPIERE-3179:record should move to editing mode when user is editing first field just fire onChange for text conponent --- .../src/org/adempiere/webui/editor/WEditor.java | 10 ++++++++++ .../src/org/adempiere/webui/editor/WNumberEditor.java | 1 + .../org/adempiere/webui/editor/WPasswordEditor.java | 2 ++ .../src/org/adempiere/webui/editor/WStringEditor.java | 1 + org.adempiere.ui.zk/index.zul | 2 +- 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java index 30353c3a4d..912dd2bd43 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java @@ -179,6 +179,16 @@ public abstract class WEditor implements EventListener, PropertyChangeLis this.strLabel = gridField.getHeader(); init(); } + + /** + * Normal zk component just fire onChange event when user loss focus + * call this method with true value let component fire event when user type first character + * @param isChangeEventWhenEditing + */ + public void setChangeEventWhenEditing (boolean isChangeEventWhenEditing){ + this.component.setWidgetOverride("isChangeEventWhenEditing", String.valueOf(isChangeEventWhenEditing)); + } + /** * Method is used to distinguish between 2 similar WSearchEditors diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java index e7dfb348b8..168ac43828 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java @@ -120,6 +120,7 @@ public class WNumberEditor extends WEditor implements ContextMenuListener private void init() { + setChangeEventWhenEditing (true); if (gridField != null) { getComponent().setTooltiptext(gridField.getDescription()); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WPasswordEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WPasswordEditor.java index 547c82f8f0..40ecdfb1fd 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WPasswordEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WPasswordEditor.java @@ -32,11 +32,13 @@ public class WPasswordEditor extends WStringEditor { super(gridField); super.setTypePassword(true); + setChangeEventWhenEditing (true); } public WPasswordEditor(GridField gridField, boolean tableEditor) { super(gridField, tableEditor); super.setTypePassword(true); + setChangeEventWhenEditing (false); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java index f1eba98400..eb50fde7b0 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java @@ -117,6 +117,7 @@ public class WStringEditor extends WEditor implements ContextMenuListener private void init(String obscureType) { + setChangeEventWhenEditing (true); if (gridField != null) { getComponent().setMaxlength(gridField.getFieldLength()); diff --git a/org.adempiere.ui.zk/index.zul b/org.adempiere.ui.zk/index.zul index 5bd08e8210..d517f2cc99 100644 --- a/org.adempiere.ui.zk/index.zul +++ b/org.adempiere.ui.zk/index.zul @@ -57,7 +57,7 @@ Copyright (C) 2007 Ashley G Ramdass. zk.override(zul.inp.InputWidget.prototype, "doInput_", function (evt) { this.$doInput_(evt); - if (this.get ("isOnStardardWindow") == 'false'){ + if (this.get ("isOnStardardWindow") == 'false' || this.get ("isChangeEventWhenEditing") != true){ return; // don't waste time to check component don't lay on standard window } From 6cea6a7b8c50825ddcde3a8af4b82747dfdaefc2 Mon Sep 17 00:00:00 2001 From: hieplq Date: Fri, 16 Sep 2016 13:11:27 +0700 Subject: [PATCH 14/16] IDEMPIERE-3192:add support short form of join when parse sql --- .../src/org/compiere/model/AccessSqlParser.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java b/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java index 10c711ba58..04a27d812b 100644 --- a/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java +++ b/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java @@ -233,6 +233,10 @@ public class AccessSqlParser from = from.replaceAll("[\r\n\t ]+LEFT[\r\n\t ]+OUTER[\r\n\t ]+JOIN[\r\n\t ]+", ", "); from = from.replaceAll("[\r\n\t ]+RIGHT[\r\n\t ]+OUTER[\r\n\t ]+JOIN[\r\n\t ]+", ", "); from = from.replaceAll("[\r\n\t ]+FULL[\r\n\t ]+JOIN[\r\n\t ]+", ", "); + from = from.replaceAll("[\r\n\t ]+LEFT[\r\n\t ]+JOIN[\r\n\t ]+", ", "); + from = from.replaceAll("[\r\n\t ]+RIGHT[\r\n\t ]+JOIN[\r\n\t ]+", ", "); + from = from.replaceAll("[\r\n\t ]+JOIN[\r\n\t ]+", ", "); + from = from.replaceAll("[\r\n\t ]+[Oo][Nn][\r\n\t ]+", ON); // teo_sarca, BF [ 2840157 ] // Remove ON clause - assumes that there is no IN () in the clause index = from.indexOf(ON); From fd178e9485a74842f93873b299bb3075c2527d84 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 23 Sep 2016 17:47:05 +0800 Subject: [PATCH 15/16] IDEMPIERE-3187 Matching PO-Receipt-Invoice doesn't displaying the Vendor Return-Document --- org.adempiere.ui/src/org/compiere/apps/form/Match.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.ui/src/org/compiere/apps/form/Match.java b/org.adempiere.ui/src/org/compiere/apps/form/Match.java index 1d4c7975b2..3cabc3f890 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/Match.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/Match.java @@ -289,7 +289,7 @@ public class Match m_sql = new StringBuffer (); int Line_ID = 0; - if (lineMatched != null ) + if (matched && lineMatched != null ) { Line_ID = lineMatched.getKey(); } From b5a746aeb310dc88d15aa750be866f2cd6ad2bde Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 26 Sep 2016 23:57:14 +0200 Subject: [PATCH 16/16] IDEMPIERE-1624 Restrict access to System dashboards / correct query --- .../model/MDashboardContentAccess.java | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MDashboardContentAccess.java b/org.adempiere.base/src/org/compiere/model/MDashboardContentAccess.java index 19a324b980..204f1f7923 100644 --- a/org.adempiere.base/src/org/compiere/model/MDashboardContentAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MDashboardContentAccess.java @@ -60,10 +60,26 @@ public class MDashboardContentAccess extends X_PA_DashboardContent_Access { .append(" WHERE PA_DashboardContent_ID NOT IN (") .append(" SELECT PA_DashboardContent_ID ") .append(" FROM PA_DashboardContent_Access" ) - .append(" WHERE AD_Client_ID IN (0, ?))") + .append(" WHERE IsActive='Y' AND AD_Client_ID IN (0, ?))") .append(" AND IsShowInLogin='Y'") - .append(" AND IsActive='Y' AND AD_Client_ID IN (0, ?)") - .append(" UNION ALL") + .append(" AND IsActive='Y' AND AD_Client_ID IN (0, ?)"); + + // New part : remove dashboard if inactive records + sql.append(" AND PA_DashboardContent_ID NOT IN (SELECT PA_DashboardContent_ID FROM PA_DashboardContent_Access ct2 WHERE ct2.IsActive='N' AND ct2.AD_Client_ID in (0,?)"); + parameters.add(AD_Client_ID); + if (AD_Role >= 0) { + sql.append(" AND COALESCE(ct2.AD_Role_ID, ?) = ?"); + parameters.add(AD_Role); + parameters.add(AD_Role); + } + if (AD_User >= 0) { + sql.append(" AND COALESCE(ct2.AD_User_ID, ?) = ?"); + parameters.add(AD_User); + parameters.add(AD_User); + } + sql.append(")"); + + sql.append(" UNION ALL") // Second part : second part is to process the dashboards configured in content access .append(" SELECT ct.PA_DashboardContent_ID,ct.ColumnNo") .append(" FROM PA_DashboardContent ct") @@ -85,20 +101,6 @@ public class MDashboardContentAccess extends X_PA_DashboardContent_Access { sql.append(" AND cta.AD_Client_ID in (0,?)"); parameters.add(AD_Client_ID); - // New part : remove dashboard if inactive records - sql.append(" AND ct.PA_DashboardContent_ID NOT IN (SELECT PA_DashboardContent_ID FROM PA_DashboardContent_Access WHERE IsActive='N' AND ct.AD_Client_ID in (0,?)"); - parameters.add(AD_Client_ID); - if (AD_Role >= 0) { - sql.append(" AND COALESCE(ct.AD_Role_ID, ?) = ?"); - parameters.add(AD_Role); - parameters.add(AD_Role); - } - if (AD_User >= 0) { - sql.append(" AND COALESCE(ct.AD_User_ID, ?) = ?"); - parameters.add(AD_User); - parameters.add(AD_User); - } - sql.append(")"); sql.append(" ORDER BY ColumnNo");