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