IDEMPIERE-471 Wrong behavior for 'Record on parent tab was changed by another user'

This commit is contained in:
Heng Sin Low 2012-11-07 10:24:27 +08:00
parent 331fab6ed4
commit 27d790d1ae
2 changed files with 28 additions and 0 deletions

View File

@ -1056,6 +1056,30 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
return false; return false;
} }
/**
* refresh current row of parent tabs
*/
public void refreshParentTabs() {
if (isDetail()) {
// get parent tab
// the parent tab is the first tab above with level = this_tab_level-1
int level = m_vo.TabLevel;
for (int i = m_window.getTabIndex(this) - 1; i >= 0; i--) {
GridTab parentTab = m_window.getTab(i);
if (parentTab.m_vo.TabLevel == level-1) {
// this is parent tab
parentTab.dataRefresh(false);
// search for the next parent
if (parentTab.isDetail()) {
level = parentTab.m_vo.TabLevel;
} else {
break;
}
}
}
}
}
/** /**
* Do we need to Save? * Do we need to Save?
* @param rowChange row change * @param rowChange row change

View File

@ -1742,6 +1742,10 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
} }
} }
if (dirtyTabpanel != null && dirtyTabpanel.getGridTab().isDetail()) {
dirtyTabpanel.getGridTab().refreshParentTabs();
}
if (callback != null) if (callback != null)
callback.onCallback(true); callback.onCallback(true);
} }