IDEMPIERE-1660
This commit is contained in:
parent
94ddd650a0
commit
534de24de3
|
@ -1582,6 +1582,17 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
|
||||||
return m_vo.IsInsertRecord;
|
return m_vo.IsInsertRecord;
|
||||||
} // isInsertRecord
|
} // isInsertRecord
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Can we Delete Records?
|
||||||
|
* @return true not read only and allowed
|
||||||
|
*/
|
||||||
|
public boolean isDeleteRecord()
|
||||||
|
{
|
||||||
|
if (isReadOnly())
|
||||||
|
return false;
|
||||||
|
return m_vo.IsDeleteable;
|
||||||
|
} // isDeleteRecord
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is the Tab Visible.
|
* Is the Tab Visible.
|
||||||
* Called when constructing the window.
|
* Called when constructing the window.
|
||||||
|
|
|
@ -1231,12 +1231,15 @@ public final class APanel extends CPanel
|
||||||
changed = false;
|
changed = false;
|
||||||
boolean readOnly = m_curTab.isReadOnly();
|
boolean readOnly = m_curTab.isReadOnly();
|
||||||
boolean insertRecord = !readOnly;
|
boolean insertRecord = !readOnly;
|
||||||
|
boolean deleteRecord = !readOnly;
|
||||||
if (insertRecord)
|
if (insertRecord)
|
||||||
insertRecord = m_curTab.isInsertRecord();
|
insertRecord = m_curTab.isInsertRecord();
|
||||||
aNew.setEnabled(!changed && insertRecord);
|
aNew.setEnabled(!changed && insertRecord);
|
||||||
aCopy.setEnabled(!changed && insertRecord);
|
aCopy.setEnabled(!changed && insertRecord);
|
||||||
aRefresh.setEnabled(!changed);
|
aRefresh.setEnabled(!changed);
|
||||||
aDelete.setEnabled(!changed && !readOnly);
|
if (deleteRecord)
|
||||||
|
deleteRecord = m_curTab.isDeleteRecord();
|
||||||
|
aDelete.setEnabled(!changed && deleteRecord);
|
||||||
aDeleteSelection.setEnabled(!changed && !readOnly);
|
aDeleteSelection.setEnabled(!changed && !readOnly);
|
||||||
//
|
//
|
||||||
if (readOnly && m_curTab.isAlwaysUpdateField())
|
if (readOnly && m_curTab.isAlwaysUpdateField())
|
||||||
|
|
|
@ -1532,6 +1532,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
||||||
boolean readOnly = adTabbox.getSelectedGridTab().isReadOnly();
|
boolean readOnly = adTabbox.getSelectedGridTab().isReadOnly();
|
||||||
boolean processed = adTabbox.getSelectedGridTab().isProcessed();
|
boolean processed = adTabbox.getSelectedGridTab().isProcessed();
|
||||||
boolean insertRecord = !readOnly;
|
boolean insertRecord = !readOnly;
|
||||||
|
boolean deleteRecord = !readOnly;
|
||||||
if (!detailTab)
|
if (!detailTab)
|
||||||
{
|
{
|
||||||
// update Change
|
// update Change
|
||||||
|
@ -1544,7 +1545,11 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
||||||
toolbar.enableNew(!changed && insertRecord && !tabPanel.getGridTab().isSortTab());
|
toolbar.enableNew(!changed && insertRecord && !tabPanel.getGridTab().isSortTab());
|
||||||
toolbar.enableCopy(!changed && insertRecord && !tabPanel.getGridTab().isSortTab() && adTabbox.getSelectedGridTab().getRowCount()>0);
|
toolbar.enableCopy(!changed && insertRecord && !tabPanel.getGridTab().isSortTab() && adTabbox.getSelectedGridTab().getRowCount()>0);
|
||||||
toolbar.enableRefresh(!changed);
|
toolbar.enableRefresh(!changed);
|
||||||
toolbar.enableDelete(!changed && !readOnly && !tabPanel.getGridTab().isSortTab() && !processed);
|
if (deleteRecord)
|
||||||
|
{
|
||||||
|
deleteRecord = tabPanel.getGridTab().isDeleteRecord();
|
||||||
|
}
|
||||||
|
toolbar.enableDelete(!changed && deleteRecord && !tabPanel.getGridTab().isSortTab() && !processed);
|
||||||
//
|
//
|
||||||
if (readOnly && adTabbox.getSelectedGridTab().isAlwaysUpdateField())
|
if (readOnly && adTabbox.getSelectedGridTab().isAlwaysUpdateField())
|
||||||
{
|
{
|
||||||
|
|
|
@ -664,12 +664,18 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
|
|
||||||
boolean insertRecord = !readOnly;
|
boolean insertRecord = !readOnly;
|
||||||
|
boolean deleteRecord = !readOnly;
|
||||||
|
|
||||||
if (insertRecord)
|
if (insertRecord)
|
||||||
{
|
{
|
||||||
insertRecord = adtab.getGridTab().isInsertRecord();
|
insertRecord = adtab.getGridTab().isInsertRecord();
|
||||||
}
|
}
|
||||||
boolean enableNew = !changed && insertRecord && !adtab.getGridTab().isSortTab();
|
boolean enableNew = !changed && insertRecord && !adtab.getGridTab().isSortTab();
|
||||||
boolean enableDelete = !changed && !readOnly && !adtab.getGridTab().isSortTab();
|
if (deleteRecord)
|
||||||
|
{
|
||||||
|
deleteRecord = adtab.getGridTab().isDeleteRecord();
|
||||||
|
}
|
||||||
|
boolean enableDelete = !changed && deleteRecord && !adtab.getGridTab().isSortTab();
|
||||||
|
|
||||||
ADWindow adwindow = ADWindow.findADWindow(this);
|
ADWindow adwindow = ADWindow.findADWindow(this);
|
||||||
if (adwindow == null)
|
if (adwindow == null)
|
||||||
|
|
Loading…
Reference in New Issue