IDEMPIERE-555 Tenant user can edit System records when AutoCommit is disabled
This commit is contained in:
parent
c6d8a41e5a
commit
d06198cc41
|
@ -93,6 +93,7 @@ import org.compiere.util.DB;
|
||||||
import org.compiere.util.DisplayType;
|
import org.compiere.util.DisplayType;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
import org.compiere.util.Msg;
|
import org.compiere.util.Msg;
|
||||||
|
import org.compiere.util.Util;
|
||||||
import org.compiere.util.WebDoc;
|
import org.compiere.util.WebDoc;
|
||||||
import org.zkoss.zk.ui.AbstractComponent;
|
import org.zkoss.zk.ui.AbstractComponent;
|
||||||
import org.zkoss.zk.ui.Component;
|
import org.zkoss.zk.ui.Component;
|
||||||
|
@ -1705,9 +1706,10 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
||||||
{
|
{
|
||||||
final boolean wasChanged = toolbar.isSaveEnable();
|
final boolean wasChanged = toolbar.isSaveEnable();
|
||||||
IADTabpanel dirtyTabpanel = adTabbox.getDirtyADTabpanel();
|
IADTabpanel dirtyTabpanel = adTabbox.getDirtyADTabpanel();
|
||||||
final boolean newRecord = dirtyTabpanel != null ? (dirtyTabpanel.getGridTab().getRecord_ID() <= 0)
|
final boolean newRecord = dirtyTabpanel != null ? (dirtyTabpanel.getGridTab().getRecord_ID() <= 0) : false;
|
||||||
: false;
|
if (dirtyTabpanel == null)
|
||||||
if (dirtyTabpanel != null && dirtyTabpanel instanceof ADSortTab)
|
onSave0(onSaveEvent, onNavigationEvent, newRecord, wasChanged, callback);
|
||||||
|
if (dirtyTabpanel instanceof ADSortTab)
|
||||||
{
|
{
|
||||||
ADSortTab sortTab = (ADSortTab) dirtyTabpanel;
|
ADSortTab sortTab = (ADSortTab) dirtyTabpanel;
|
||||||
sortTab.saveData();
|
sortTab.saveData();
|
||||||
|
@ -1729,8 +1731,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((dirtyTabpanel != null && dirtyTabpanel.getGridTab().getCommitWarning() != null
|
if (!Util.isEmpty(dirtyTabpanel.getGridTab().getCommitWarning()) ||
|
||||||
&& dirtyTabpanel.getGridTab().getCommitWarning().trim().length() > 0) ||
|
|
||||||
(!Env.isAutoCommit(ctx, curWindowNo) && onNavigationEvent))
|
(!Env.isAutoCommit(ctx, curWindowNo) && onNavigationEvent))
|
||||||
{
|
{
|
||||||
FDialog.ask(curWindowNo, this.getComponent(), "SaveChanges?", dirtyTabpanel.getGridTab().getCommitWarning(), new Callback<Boolean>() {
|
FDialog.ask(curWindowNo, this.getComponent(), "SaveChanges?", dirtyTabpanel.getGridTab().getCommitWarning(), new Callback<Boolean>() {
|
||||||
|
|
Loading…
Reference in New Issue