From e33cadc2f9b3f7e452e5d9189e755d6f41dd0bb7 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 18 Jan 2024 07:22:13 +0100 Subject: [PATCH] IDEMPIERE-6002 Recent Items not working when UUID field is inactive (#2198) * IDEMPIERE-6002 Recent Items not working when UUID field is inactive * - add missing fields in core windows: Product > BOM Product > Components Remuneration > Remuneration Remuneration > Position Remuneration Remuneration > Employee Remuneration Revenue Recognition > Revenue Recognition Revenue Recognition > Service Revenue Recognition > Revenue Recognition Plan Revenue Recognition > Revenue Recognition Run Validation Rules > Used in Column (Lookup) * - sync postgresql and oracle scripts --- .../oracle/202401171352_IDEMPIERE-6002.sql | 46 +++++++++++++++++++ .../202401171352_IDEMPIERE-6002.sql | 43 +++++++++++++++++ .../src/org/compiere/model/MRecentItem.java | 11 +++-- .../src/org/compiere/model/PO.java | 2 +- .../adwindow/AbstractADWindowContent.java | 4 +- .../webui/dashboard/DPRecentItems.java | 9 +++- 6 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 migration/iD11/oracle/202401171352_IDEMPIERE-6002.sql create mode 100644 migration/iD11/postgresql/202401171352_IDEMPIERE-6002.sql diff --git a/migration/iD11/oracle/202401171352_IDEMPIERE-6002.sql b/migration/iD11/oracle/202401171352_IDEMPIERE-6002.sql new file mode 100644 index 0000000000..41f02deadd --- /dev/null +++ b/migration/iD11/oracle/202401171352_IDEMPIERE-6002.sql @@ -0,0 +1,46 @@ +-- IDEMPIERE-6002 +SELECT register_migration_script('202401171352_IDEMPIERE-6002.sql') FROM dual; + +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Jan 17, 2024, 1:52:26 PM 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 (208124,'PP_Product_BOM_UU',53286,60999,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 13:52:26','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 13:52:26','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','EE01','24fc9cf4-89f7-4593-a16a-e65e2ce0c71b','N',2) +; + +-- Jan 17, 2024, 1:52:38 PM 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 (208126,'PP_Product_BOMLine_UU',53287,61000,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 13:52:38','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 13:52:38','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','EE01','a2fba48d-de3d-4984-98c7-913192f32336','N',2) +; + +-- Jan 17, 2024, 2:33:24 PM 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 (208127,'C_UserRemuneration_UU',727,60785,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:33:23','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:33:23','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','ac53d015-b81e-4845-8e02-a4d96c37bfd1','N',2) +; + +-- Jan 17, 2024, 2:33:39 PM 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 (208128,'C_Remuneration_UU',725,60748,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:33:39','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:33:39','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','22a4c7a5-1c81-474f-bfe0-5d73b99aba1a','N',2) +; + +-- Jan 17, 2024, 2:34:16 PM 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 (208129,'C_JobRemuneration_UU',726,60672,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:34:15','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:34:15','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','89ea5b06-db1f-4d4a-8bc9-deef934c0a99','N',2) +; + +-- Jan 17, 2024, 2:34:42 PM 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 (208130,'C_RevenueRecognition_UU',272,60749,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:34:42','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:34:42','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','2ebbba1e-d619-4b70-a2f1-2c73f7325ab8','N',2) +; + +-- Jan 17, 2024, 2:34:53 PM 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 (208131,'C_RevenueRecog_Service_UU',54010,213821,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:34:52','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:34:52','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','fca1c37f-d263-4f3e-aa58-3db1631fd8bd','N',2) +; + +-- Jan 17, 2024, 2:35:29 PM 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 (208132,'C_RevenueRecognition_Plan_UU',378,60750,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:35:28','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:35:28','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','3dfc30f9-e6f4-4f53-b884-e6d588e6421e','N',2) +; + +-- Jan 17, 2024, 2:35:36 PM 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 (208133,'C_RevenueRecognition_Run_UU',379,60751,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:35:36','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:35:36','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','db5a1b37-d659-4235-bd38-90771d52a742','N',2) +; + +-- Jan 17, 2024, 2:36:25 PM 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 (208170,'AD_Column_UU',200269,60388,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:36:25','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:36:25','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','b98179ad-9664-4692-beb5-bc6953fe0678','N',2) +; + diff --git a/migration/iD11/postgresql/202401171352_IDEMPIERE-6002.sql b/migration/iD11/postgresql/202401171352_IDEMPIERE-6002.sql new file mode 100644 index 0000000000..52b6527211 --- /dev/null +++ b/migration/iD11/postgresql/202401171352_IDEMPIERE-6002.sql @@ -0,0 +1,43 @@ +-- IDEMPIERE-6002 +SELECT register_migration_script('202401171352_IDEMPIERE-6002.sql') FROM dual; + +-- Jan 17, 2024, 1:52:26 PM 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 (208124,'PP_Product_BOM_UU',53286,60999,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 13:52:26','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 13:52:26','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','EE01','24fc9cf4-89f7-4593-a16a-e65e2ce0c71b','N',2) +; + +-- Jan 17, 2024, 1:52:38 PM 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 (208126,'PP_Product_BOMLine_UU',53287,61000,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 13:52:38','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 13:52:38','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','EE01','a2fba48d-de3d-4984-98c7-913192f32336','N',2) +; + +-- Jan 17, 2024, 2:33:24 PM 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 (208127,'C_UserRemuneration_UU',727,60785,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:33:23','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:33:23','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','ac53d015-b81e-4845-8e02-a4d96c37bfd1','N',2) +; + +-- Jan 17, 2024, 2:33:39 PM 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 (208128,'C_Remuneration_UU',725,60748,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:33:39','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:33:39','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','22a4c7a5-1c81-474f-bfe0-5d73b99aba1a','N',2) +; + +-- Jan 17, 2024, 2:34:16 PM 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 (208129,'C_JobRemuneration_UU',726,60672,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:34:15','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:34:15','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','89ea5b06-db1f-4d4a-8bc9-deef934c0a99','N',2) +; + +-- Jan 17, 2024, 2:34:42 PM 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 (208130,'C_RevenueRecognition_UU',272,60749,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:34:42','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:34:42','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','2ebbba1e-d619-4b70-a2f1-2c73f7325ab8','N',2) +; + +-- Jan 17, 2024, 2:34:53 PM 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 (208131,'C_RevenueRecog_Service_UU',54010,213821,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:34:52','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:34:52','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','fca1c37f-d263-4f3e-aa58-3db1631fd8bd','N',2) +; + +-- Jan 17, 2024, 2:35:29 PM 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 (208132,'C_RevenueRecognition_Plan_UU',378,60750,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:35:28','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:35:28','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','3dfc30f9-e6f4-4f53-b884-e6d588e6421e','N',2) +; + +-- Jan 17, 2024, 2:35:36 PM 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 (208133,'C_RevenueRecognition_Run_UU',379,60751,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:35:36','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:35:36','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','db5a1b37-d659-4235-bd38-90771d52a742','N',2) +; + +-- Jan 17, 2024, 2:36:25 PM 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 (208170,'AD_Column_UU',200269,60388,'N',36,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-01-17 14:36:25','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-01-17 14:36:25','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','b98179ad-9664-4692-beb5-bc6953fe0678','N',2) +; + diff --git a/org.adempiere.base/src/org/compiere/model/MRecentItem.java b/org.adempiere.base/src/org/compiere/model/MRecentItem.java index fd7a2226f1..72375533f2 100644 --- a/org.adempiere.base/src/org/compiere/model/MRecentItem.java +++ b/org.adempiere.base/src/org/compiere/model/MRecentItem.java @@ -42,9 +42,9 @@ import org.osgi.service.event.Event; public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport { /** - * generated serial id + * */ - private static final long serialVersionUID = 4298877865937943663L; + private static final long serialVersionUID = 6284848250030738141L; public static final String ON_RECENT_ITEM_CHANGED_TOPIC = "onRecentItemChanged"; @@ -409,13 +409,16 @@ public class MRecentItem extends X_AD_RecentItem implements ImmutablePOSupport /** * Clear the label (to display) cache in a recent item instance. * @param AD_Table_ID + * @param Record_ID * @param Record_UU */ - public static synchronized void clearLabel(int AD_Table_ID, String Record_UU) { + public static synchronized void clearLabel(int AD_Table_ID, int Record_ID, String Record_UU) { Iterator it = s_cache.values().iterator(); while (it.hasNext()) { MRecentItem retValue = it.next(); - if (retValue.getAD_Table_ID() == AD_Table_ID && retValue.getRecord_UU().equals(Record_UU)) { + if ( retValue.getAD_Table_ID() == AD_Table_ID + && ( (Record_ID > 0 && retValue.getRecord_ID() == Record_ID) + || (retValue.getRecord_UU() != null && retValue.getRecord_UU().equals(Record_UU)))) { retValue.clearLabel(); } } diff --git a/org.adempiere.base/src/org/compiere/model/PO.java b/org.adempiere.base/src/org/compiere/model/PO.java index 69a3d4ab9b..087ce327ec 100644 --- a/org.adempiere.base/src/org/compiere/model/PO.java +++ b/org.adempiere.base/src/org/compiere/model/PO.java @@ -2692,7 +2692,7 @@ public abstract class PO m_createNew = false; } if (!newRecord) - MRecentItem.clearLabel(p_info.getAD_Table_ID(), get_UUID()); + MRecentItem.clearLabel(p_info.getAD_Table_ID(), get_ID(), get_UUID()); if (CacheMgt.get().hasCache(p_info.getTableName())) { boolean cacheResetScheduled = false; if (get_TrxName() != null) { 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 ae00867d2c..13dd8c1929 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 @@ -2008,7 +2008,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements //update recent item if (changed && !readOnly && !toolbar.isSaveEnable() ) { - if (!Util.isEmpty(tabPanel.getGridTab().getRecord_UU())) { + if (!Util.isEmpty(tabPanel.getGridTab().getRecord_UU()) || tabPanel.getGridTab().getRecord_ID() > 0) { if (adTabbox.getSelectedIndex() == 0 && !detailTab) { MRecentItem.addModifiedField(ctx, adTabbox.getSelectedGridTab().getAD_Table_ID(), adTabbox.getSelectedGridTab().getRecord_ID(), adTabbox.getSelectedGridTab().getRecord_UU(), Env.getAD_User_ID(ctx), @@ -2858,7 +2858,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements if (wasChanged) { if (newRecord) { - if (!Util.isEmpty(adTabbox.getSelectedGridTab().getRecord_UU())) { + if (!Util.isEmpty(adTabbox.getSelectedGridTab().getRecord_UU()) || adTabbox.getSelectedGridTab().getRecord_ID() > 0) { if (adTabbox.getSelectedIndex() == 0) { MRecentItem.addModifiedField(ctx, adTabbox.getSelectedGridTab().getAD_Table_ID(), adTabbox.getSelectedGridTab().getRecord_ID(), adTabbox.getSelectedGridTab().getRecord_UU(), Env.getAD_User_ID(ctx), diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPRecentItems.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPRecentItems.java index d33cee08d8..2b25d13744 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPRecentItems.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPRecentItems.java @@ -233,8 +233,13 @@ public class DPRecentItems extends DashboardPanel implements EventListener 0) { MRecentItem ri = MRecentItem.get(Env.getCtx(), AD_RecentItem_ID); - String TableName = MTable.getTableName(Env.getCtx(), ri.getAD_Table_ID()); - MQuery query = MQuery.getEqualQuery(PO.getUUIDColumnName(TableName), ri.getRecord_UU()); + MTable table = MTable.get(ri.getAD_Table_ID()); + String TableName = table.getTableName(); + MQuery query; + if (ri.getRecord_UU() != null) + query = MQuery.getEqualQuery(PO.getUUIDColumnName(TableName), ri.getRecord_UU()); + else + query = MQuery.getEqualQuery(table.getKeyColumns()[0], ri.getRecord_ID()); SessionManager.getAppDesktop().openWindow(ri.getAD_Window_ID(), query, null); } }