IDEMPIERE-1268 Payment Allocation is getting deleted from completed Payment record. Fixed handling of readonly logic for detailpane and processed flag for header tab.

This commit is contained in:
Heng Sin Low 2013-08-22 23:11:45 +08:00
parent bce1989d05
commit 49d501692c
2 changed files with 3 additions and 2 deletions

View File

@ -1389,6 +1389,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
boolean changed = e.isChanged() || e.isInserting();
boolean readOnly = adTabbox.getSelectedGridTab().isReadOnly();
boolean processed = adTabbox.getSelectedGridTab().isProcessed();
boolean insertRecord = !readOnly;
if (!detailTab)
{
@ -1401,7 +1402,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
}
toolbar.enableNew(!changed && insertRecord && !tabPanel.getGridTab().isSortTab());
toolbar.enableRefresh(!changed);
toolbar.enableDelete(!changed && !readOnly && !tabPanel.getGridTab().isSortTab());
toolbar.enableDelete(!changed && !readOnly && !tabPanel.getGridTab().isSortTab() && !processed);
//
if (readOnly && adTabbox.getSelectedGridTab().isAlwaysUpdateField())
{

View File

@ -542,7 +542,7 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
Toolbar toolbar = (Toolbar) tabpanel.getFirstChild();
IADTabpanel adtab = getADTabpanel(index);
if (adtab!=null && adtab.getGridTab().isSortTab())
if (adtab!=null && (adtab.getGridTab().isSortTab() || adtab.getGridTab().isReadOnly()))
readOnly = true;
boolean insertRecord = !readOnly;