IDEMPIERE-37 Make iDempiere safer using saveEx instead of save
This commit is contained in:
parent
4de5a6bb87
commit
f961ec5eb0
|
@ -60,7 +60,7 @@ public class MAd extends X_CM_Ad
|
||||||
setActualImpression(getActualImpression()+1);
|
setActualImpression(getActualImpression()+1);
|
||||||
if (getCurrentImpression()>=getMaxImpression())
|
if (getCurrentImpression()>=getMaxImpression())
|
||||||
setIsActive(false);
|
setIsActive(false);
|
||||||
save();
|
saveEx();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -95,6 +95,6 @@ public class MAd extends X_CM_Ad
|
||||||
setActualClick(getActualClick()+1);
|
setActualClick(getActualClick()+1);
|
||||||
if (getActualClick()>getMaxClick())
|
if (getActualClick()>getMaxClick())
|
||||||
setIsActive(true);
|
setIsActive(true);
|
||||||
save();
|
saveEx();
|
||||||
}
|
}
|
||||||
} // MAd
|
} // MAd
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class MAssetDelivery extends X_A_Asset_Delivery
|
||||||
// Who
|
// Who
|
||||||
setAD_User_ID(AD_User_ID);
|
setAD_User_ID(AD_User_ID);
|
||||||
//
|
//
|
||||||
save();
|
saveEx();
|
||||||
} // MAssetDelivery
|
} // MAssetDelivery
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -115,7 +115,7 @@ public class MAssetDelivery extends X_A_Asset_Delivery
|
||||||
// Who
|
// Who
|
||||||
setAD_User_ID(AD_User_ID);
|
setAD_User_ID(AD_User_ID);
|
||||||
//
|
//
|
||||||
save();
|
saveEx();
|
||||||
} // MAssetDelivery
|
} // MAssetDelivery
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -256,7 +256,7 @@ public class MDistribution extends X_GL_Distribution
|
||||||
if (get_ID() != 0 && PercentTotal.compareTo(getPercentTotal()) != 0)
|
if (get_ID() != 0 && PercentTotal.compareTo(getPercentTotal()) != 0)
|
||||||
{
|
{
|
||||||
setPercentTotal(PercentTotal);
|
setPercentTotal(PercentTotal);
|
||||||
save();
|
saveEx();
|
||||||
}
|
}
|
||||||
// return
|
// return
|
||||||
m_lines = new MDistributionLine[list.size ()];
|
m_lines = new MDistributionLine[list.size ()];
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class MDistributionList extends X_M_DistributionList
|
||||||
{
|
{
|
||||||
log.info("getLines - Set RatioTotal from " + getRatioTotal() + " to " + ratioTotal);
|
log.info("getLines - Set RatioTotal from " + getRatioTotal() + " to " + ratioTotal);
|
||||||
setRatioTotal(ratioTotal);
|
setRatioTotal(ratioTotal);
|
||||||
save();
|
saveEx();
|
||||||
}
|
}
|
||||||
|
|
||||||
MDistributionListLine[] retValue = new MDistributionListLine[list.size ()];
|
MDistributionListLine[] retValue = new MDistributionListLine[list.size ()];
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class MDistributionRunDetail extends X_T_DistributionRunDetail
|
||||||
dirty = true;
|
dirty = true;
|
||||||
}
|
}
|
||||||
if (dirty)
|
if (dirty)
|
||||||
save();
|
saveEx();
|
||||||
} // round
|
} // round
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -657,7 +657,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
|
|
||||||
//[ 1948157 ]
|
//[ 1948157 ]
|
||||||
setReversal_ID(reverse.getGL_JournalBatch_ID());
|
setReversal_ID(reverse.getGL_JournalBatch_ID());
|
||||||
save();
|
saveEx();
|
||||||
// After reverseCorrect
|
// After reverseCorrect
|
||||||
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
if (m_processMsg != null)
|
if (m_processMsg != null)
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class MLotCtl extends X_M_LotCtl
|
||||||
//
|
//
|
||||||
no += getIncrementNo();
|
no += getIncrementNo();
|
||||||
setCurrentNext(no);
|
setCurrentNext(no);
|
||||||
save();
|
saveEx();
|
||||||
//
|
//
|
||||||
MLot retValue = new MLot (this, M_Product_ID, name.toString());
|
MLot retValue = new MLot (this, M_Product_ID, name.toString());
|
||||||
retValue.saveEx();
|
retValue.saveEx();
|
||||||
|
|
|
@ -528,7 +528,7 @@ public final class MPayment extends X_C_Payment
|
||||||
}
|
}
|
||||||
// Process it
|
// Process it
|
||||||
retValue = processOnline();
|
retValue = processOnline();
|
||||||
save();
|
saveEx();
|
||||||
return retValue; // Payment processed
|
return retValue; // Payment processed
|
||||||
} // startProcess
|
} // startProcess
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ public class MRecurring extends X_C_Recurring
|
||||||
int current = DB.getSQLValue(get_TrxName(), sql, getC_Recurring_ID());
|
int current = DB.getSQLValue(get_TrxName(), sql, getC_Recurring_ID());
|
||||||
int remaining = getRunsMax() - current;
|
int remaining = getRunsMax() - current;
|
||||||
setRunsRemaining(remaining);
|
setRunsRemaining(remaining);
|
||||||
save();
|
saveEx();
|
||||||
return remaining > 0;
|
return remaining > 0;
|
||||||
} // calculateRuns
|
} // calculateRuns
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,7 @@ public class MRegistration extends X_A_Registration
|
||||||
{
|
{
|
||||||
// save if not saved
|
// save if not saved
|
||||||
if (get_ID() == 0)
|
if (get_ID() == 0)
|
||||||
save();
|
saveEx();
|
||||||
int count = 0;
|
int count = 0;
|
||||||
// read values for all attributes
|
// read values for all attributes
|
||||||
MRegistrationAttribute[] attributes = getAttributes();
|
MRegistrationAttribute[] attributes = getAttributes();
|
||||||
|
@ -238,7 +238,7 @@ public class MRegistration extends X_A_Registration
|
||||||
{
|
{
|
||||||
// save if not saved
|
// save if not saved
|
||||||
if (get_ID() == 0)
|
if (get_ID() == 0)
|
||||||
save();
|
saveEx();
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
// Get All Values
|
// Get All Values
|
||||||
|
|
|
@ -139,7 +139,7 @@ public class MRfQResponse extends X_C_RfQResponse
|
||||||
continue;
|
continue;
|
||||||
//
|
//
|
||||||
if (get_ID() == 0) // save Response
|
if (get_ID() == 0) // save Response
|
||||||
save();
|
saveEx();
|
||||||
|
|
||||||
MRfQResponseLine line = new MRfQResponseLine (this, lines[i]);
|
MRfQResponseLine line = new MRfQResponseLine (this, lines[i]);
|
||||||
// line is not saved (dumped) if there are no Qtys
|
// line is not saved (dumped) if there are no Qtys
|
||||||
|
@ -261,7 +261,7 @@ public class MRfQResponse extends X_C_RfQResponse
|
||||||
if (EMail.SENT_OK.equals(email.send()))
|
if (EMail.SENT_OK.equals(email.send()))
|
||||||
{
|
{
|
||||||
setDateInvited(new Timestamp (System.currentTimeMillis()));
|
setDateInvited(new Timestamp (System.currentTimeMillis()));
|
||||||
save();
|
saveEx();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class MRfQResponseLine extends X_C_RfQResponseLine
|
||||||
if (qtys[i].isActive() && qtys[i].isRfQQty())
|
if (qtys[i].isActive() && qtys[i].isRfQQty())
|
||||||
{
|
{
|
||||||
if (get_ID() == 0) // save this line
|
if (get_ID() == 0) // save this line
|
||||||
save();
|
saveEx();
|
||||||
MRfQResponseLineQty qty = new MRfQResponseLineQty (this, qtys[i]);
|
MRfQResponseLineQty qty = new MRfQResponseLineQty (this, qtys[i]);
|
||||||
qty.saveEx();
|
qty.saveEx();
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class MSerNoCtl extends X_M_SerNoCtl
|
||||||
//
|
//
|
||||||
no += getIncrementNo();
|
no += getIncrementNo();
|
||||||
setCurrentNext(no);
|
setCurrentNext(no);
|
||||||
save();
|
saveEx();
|
||||||
return name.toString();
|
return name.toString();
|
||||||
} // createSerNo
|
} // createSerNo
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ public class MSession extends X_AD_Session
|
||||||
public void logout()
|
public void logout()
|
||||||
{
|
{
|
||||||
setProcessed(true);
|
setProcessed(true);
|
||||||
save();
|
saveEx();
|
||||||
s_sessions.remove(new Integer(getAD_Session_ID()));
|
s_sessions.remove(new Integer(getAD_Session_ID()));
|
||||||
log.info(TimeUtil.formatElapsed(getCreated(), getUpdated()));
|
log.info(TimeUtil.formatElapsed(getCreated(), getUpdated()));
|
||||||
} // logout
|
} // logout
|
||||||
|
|
|
@ -106,7 +106,7 @@ public class MWFNodePara extends X_AD_WF_Node_Para
|
||||||
{
|
{
|
||||||
an = getProcessPara().getColumnName();
|
an = getProcessPara().getColumnName();
|
||||||
setAttributeName(an);
|
setAttributeName(an);
|
||||||
save();
|
saveEx();
|
||||||
}
|
}
|
||||||
return an;
|
return an;
|
||||||
} // getAttributeName
|
} // getAttributeName
|
||||||
|
|
|
@ -224,7 +224,7 @@ public class MWFProcess extends X_AD_WF_Process
|
||||||
m_state = new StateEngine (getWFState());
|
m_state = new StateEngine (getWFState());
|
||||||
if (m_state.isClosed())
|
if (m_state.isClosed())
|
||||||
setProcessed(true);
|
setProcessed(true);
|
||||||
save();
|
saveEx();
|
||||||
// Force close to all Activities
|
// Force close to all Activities
|
||||||
if (m_state.isClosed())
|
if (m_state.isClosed())
|
||||||
{
|
{
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class PosOrderModel extends MOrder {
|
||||||
{
|
{
|
||||||
lineas[i].setC_BPartner_ID(partner.getC_BPartner_ID());
|
lineas[i].setC_BPartner_ID(partner.getC_BPartner_ID());
|
||||||
lineas[i].setTax();
|
lineas[i].setTax();
|
||||||
lineas[i].save();
|
lineas[i].saveEx();
|
||||||
}
|
}
|
||||||
saveEx();
|
saveEx();
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ public class PosOrderModel extends MOrder {
|
||||||
lines[i].setPrice(); // sets List/limit
|
lines[i].setPrice(); // sets List/limit
|
||||||
if ( PriceActual.compareTo(Env.ZERO) > 0 )
|
if ( PriceActual.compareTo(Env.ZERO) > 0 )
|
||||||
lines[i].setPrice(PriceActual);
|
lines[i].setPrice(PriceActual);
|
||||||
lines[i].save();
|
lines[i].saveEx();
|
||||||
return lines[i];
|
return lines[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ public class PosOrderModel extends MOrder {
|
||||||
line.setPrice(); // sets List/limit
|
line.setPrice(); // sets List/limit
|
||||||
if ( PriceActual.compareTo(Env.ZERO) > 0 )
|
if ( PriceActual.compareTo(Env.ZERO) > 0 )
|
||||||
line.setPrice(PriceActual);
|
line.setPrice(PriceActual);
|
||||||
line.save();
|
line.saveEx();
|
||||||
return line;
|
return line;
|
||||||
|
|
||||||
} // createLine
|
} // createLine
|
||||||
|
@ -211,7 +211,7 @@ public class PosOrderModel extends MOrder {
|
||||||
getLines(true, null); // requery order
|
getLines(true, null); // requery order
|
||||||
setDocStatus("VO");//delete(true); red1 -- should not delete but void the order
|
setDocStatus("VO");//delete(true); red1 -- should not delete but void the order
|
||||||
setProcessed(true); //red1 -- to avoid been in history during query
|
setProcessed(true); //red1 -- to avoid been in history during query
|
||||||
save();
|
saveEx();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -253,7 +253,7 @@ public class PosOrderModel extends MOrder {
|
||||||
{
|
{
|
||||||
if (processIt(DocAction.ACTION_Complete) )
|
if (processIt(DocAction.ACTION_Complete) )
|
||||||
{
|
{
|
||||||
save();
|
saveEx();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -320,12 +320,12 @@ public class PosOrderModel extends MOrder {
|
||||||
payment.setC_CashBook_ID(m_pos.getC_CashBook_ID());
|
payment.setC_CashBook_ID(m_pos.getC_CashBook_ID());
|
||||||
payment.setAmount(getC_Currency_ID(), amt);
|
payment.setAmount(getC_Currency_ID(), amt);
|
||||||
payment.setC_BankAccount_ID(m_pos.getC_BankAccount_ID());
|
payment.setC_BankAccount_ID(m_pos.getC_BankAccount_ID());
|
||||||
payment.save();
|
payment.saveEx();
|
||||||
payment.setDocAction(MPayment.DOCACTION_Complete);
|
payment.setDocAction(MPayment.DOCACTION_Complete);
|
||||||
payment.setDocStatus(MPayment.DOCSTATUS_Drafted);
|
payment.setDocStatus(MPayment.DOCSTATUS_Drafted);
|
||||||
if ( payment.processIt(MPayment.DOCACTION_Complete) )
|
if ( payment.processIt(MPayment.DOCACTION_Complete) )
|
||||||
{
|
{
|
||||||
payment.save();
|
payment.saveEx();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else return false;
|
else return false;
|
||||||
|
|
Loading…
Reference in New Issue