IDEMPIERE-2125 Error in creating recent item avoids to save any record

This commit is contained in:
Thomas Bayen 2014-08-08 18:59:42 +02:00
parent 0fae275b28
commit d76804a007
1 changed files with 7 additions and 1 deletions

View File

@ -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),