From d76804a007226a11358dfff235eb14ca03ccf02f Mon Sep 17 00:00:00 2001 From: Thomas Bayen Date: Fri, 8 Aug 2014 18:59:42 +0200 Subject: [PATCH] IDEMPIERE-2125 Error in creating recent item avoids to save any record --- .../adempiere/webui/adwindow/AbstractADWindowContent.java | 8 +++++++- 1 file changed, 7 insertions(+), 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 9d9bb0c83c..6548fcea4e 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 @@ -1518,7 +1518,13 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements adTabbox.getSelectedGridTab().getAD_Tab_ID()); } else { /* when a detail record is modified add header to recent items */ - GridTab mainTab = gridWindow.getTab(0); + GridTab mainTab = adTabbox.getSelectedGridTab(); // find parent tab (IDEMPIERE-2125 - tbayen) + while (mainTab != null && mainTab.getTabLevel() > 0) { + GridTab parentTab = mainTab.getParentTab(); + if (parentTab == mainTab) + break; + mainTab = parentTab; + } if (mainTab != null) { MRecentItem.addModifiedField(ctx, mainTab.getAD_Table_ID(), mainTab.getRecord_ID(), Env.getAD_User_ID(ctx),