IDEMPIERE-37 Make iDempiere safer using saveEx instead of save

http://jira.idempiere.com/browse/IDEMPIERE-37
This commit is contained in:
Carlos Ruiz 2012-03-28 11:55:10 -05:00
parent 929a1f4303
commit 43efec55a3
17 changed files with 55 additions and 55 deletions

View File

@ -142,7 +142,7 @@ public class BPartnerOrgLink extends SvrProcess
{
mLoc = new MLocator (wh, "Standard");
mLoc.setIsDefault(true);
mLoc.save(get_TrxName());
mLoc.saveEx(get_TrxName());
}
// Update/Save Org Info
@ -176,7 +176,7 @@ public class BPartnerOrgLink extends SvrProcess
if (!found)
{
MRoleOrgAccess orgAccess = new MRoleOrgAccess (org, p_AD_Role_ID);
orgAccess.save(get_TrxName());
orgAccess.saveEx(get_TrxName());
}
}

View File

@ -85,7 +85,7 @@ public class M_Product_BOM_Check extends SvrProcess
log.info("NOT BOM Product");
// No BOM - should not happen, but no problem
xp.setIsVerified(true);
xp.save(get_TrxName());
xp.saveEx(get_TrxName());
return "OK";
}
@ -170,7 +170,7 @@ public class M_Product_BOM_Check extends SvrProcess
// Finish process
xp.setIsVerified(true);
xp.save(get_TrxName());
xp.saveEx(get_TrxName());
return "OK";
} // doIt

View File

@ -111,7 +111,7 @@ public class MAdvertisement extends X_W_Advertisement
if (m_clickCount != null)
{
m_clickCount.setTargetURL(TargetURL);
m_clickCount.save(get_TrxName());
m_clickCount.saveEx(get_TrxName());
}
} // getClickTargetURL

View File

@ -387,7 +387,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
{
MPayment payment = new MPayment (getCtx(), line.getC_Payment_ID(), get_TrxName());
payment.setIsReconciled(true);
payment.save(get_TrxName());
payment.saveEx(get_TrxName());
}
}
// Update Bank Account
@ -395,7 +395,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
ba.load(get_TrxName());
//BF 1933645
ba.setCurrentBalance(ba.getCurrentBalance().add(getStatementDifference()));
ba.save(get_TrxName());
ba.saveEx(get_TrxName());
// User Validation
String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE);

View File

@ -287,7 +287,7 @@ public class MCStage extends X_CM_CStage
thisElement.setCM_CStage_ID(this.get_ID());
thisElement.setContentHTML(" ");
thisElement.setName(elementName);
thisElement.save(get_TrxName());
thisElement.saveEx(get_TrxName());
}
}

View File

@ -106,7 +106,7 @@ public class MExpenseType extends X_S_ExpenseType
MProduct prod = getProduct();
if (prod.setExpenseType(this))
prod.save(get_TrxName());
prod.saveEx(get_TrxName());
return success;
} // afterSave

View File

@ -743,7 +743,7 @@ public class MInOut extends X_M_InOut implements DocAction
if (counter)
{
fromLine.setRef_InOutLine_ID(line.getM_InOutLine_ID());
fromLine.save(get_TrxName());
fromLine.saveEx(get_TrxName());
}
}
if (fromLines.length != count) {
@ -1544,7 +1544,7 @@ public class MInOut extends X_M_InOut implements DocAction
&& sLine.getMovementQty().compareTo(oLine.getQtyOrdered()) == 0) // just if full match [ 1876965 ]
{
oLine.setM_AttributeSetInstance_ID(sLine.getM_AttributeSetInstance_ID());
oLine.save(get_TrxName());
oLine.saveEx(get_TrxName());
}
}
else // No Order - Try finding links via Invoice
@ -1573,7 +1573,7 @@ public class MInOut extends X_M_InOut implements DocAction
&& sLine.getMovementQty().compareTo(oLine.getQtyOrdered()) == 0) // just if full match [ 1876965 ]
{
oLine.setM_AttributeSetInstance_ID(sLine.getM_AttributeSetInstance_ID());
oLine.save(get_TrxName());
oLine.saveEx(get_TrxName());
}
}
} // No Order
@ -1667,7 +1667,7 @@ public class MInOut extends X_M_InOut implements DocAction
// References (Should not be required
dropShipment.setSalesRep_ID(getSalesRep_ID());
dropShipment.save(get_TrxName());
dropShipment.saveEx(get_TrxName());
// Update line order references to linked sales order lines
MInOutLine[] lines = dropShipment.getLines(true);
@ -1877,7 +1877,7 @@ public class MInOut extends X_M_InOut implements DocAction
// Refernces (Should not be required
counter.setSalesRep_ID(getSalesRep_ID());
counter.save(get_TrxName());
counter.saveEx(get_TrxName());
String MovementType = counter.getMovementType();
boolean inTrx = MovementType.charAt(1) == '+'; // V+ Vendor Receipt
@ -1892,7 +1892,7 @@ public class MInOut extends X_M_InOut implements DocAction
counterLine.setM_Locator_ID(0);
counterLine.setM_Locator_ID(inTrx ? Env.ZERO : counterLine.getMovementQty());
//
counterLine.save(get_TrxName());
counterLine.saveEx(get_TrxName());
}
log.fine(counter.toString());
@ -1904,7 +1904,7 @@ public class MInOut extends X_M_InOut implements DocAction
{
counter.setDocAction(counterDT.getDocAction());
counter.processIt(counterDT.getDocAction());
counter.save(get_TrxName());
counter.saveEx(get_TrxName());
}
}
return counter;
@ -1947,7 +1947,7 @@ public class MInOut extends X_M_InOut implements DocAction
{
line.setQty(Env.ZERO);
line.addDescription("Void (" + old + ")");
line.save(get_TrxName());
line.saveEx(get_TrxName());
}
}
//

View File

@ -706,7 +706,7 @@ public class MInventory extends X_M_Inventory implements DocAction
line.setQtyInternalUse(Env.ZERO);
line.setQtyCount(line.getQtyBook());
line.addDescription("Void (" + oldCount + "/" + oldInternal + ")");
line.save(get_TrxName());
line.saveEx(get_TrxName());
}
}
}

View File

@ -761,7 +761,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
if (counter)
{
fromLine.setRef_InvoiceLine_ID(line.getC_InvoiceLine_ID());
fromLine.save(get_TrxName());
fromLine.saveEx(get_TrxName());
}
// MZ Goodwill
@ -2004,7 +2004,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
counter.setBPartner(counterBP);
// Refernces (Should not be required
counter.setSalesRep_ID(getSalesRep_ID());
counter.save(get_TrxName());
counter.saveEx(get_TrxName());
// Update copied lines
MInvoiceLine[] counterLines = counter.getLines(true);
@ -2016,7 +2016,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
counterLine.setPrice();
counterLine.setTax();
//
counterLine.save(get_TrxName());
counterLine.saveEx(get_TrxName());
}
log.fine(counter.toString());
@ -2028,7 +2028,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
{
counter.setDocAction(counterDT.getDocAction());
counter.processIt(counterDT.getDocAction());
counter.save(get_TrxName());
counter.saveEx(get_TrxName());
}
}
return counter;
@ -2080,10 +2080,10 @@ public class MInvoice extends X_C_Invoice implements DocAction
{
MInOutLine ioLine = new MInOutLine(getCtx(), line.getM_InOutLine_ID(), get_TrxName());
ioLine.setIsInvoiced(false);
ioLine.save(get_TrxName());
ioLine.saveEx(get_TrxName());
line.setM_InOutLine_ID(0);
}
line.save(get_TrxName());
line.saveEx(get_TrxName());
}
}
addDescription(Msg.getMsg(getCtx(), "Voided"));
@ -2147,7 +2147,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
{
allocations[i].setDocAction(DocAction.ACTION_Reverse_Correct);
allocations[i].reverseCorrectIt();
allocations[i].save(get_TrxName());
allocations[i].saveEx(get_TrxName());
}
// Reverse/Delete Matching
if (!isSOTrx())
@ -2163,7 +2163,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
else
{
mPO[i].setC_InvoiceLine_ID(null);
mPO[i].save(get_TrxName());
mPO[i].saveEx(get_TrxName());
}
}
}
@ -2232,10 +2232,10 @@ public class MInvoice extends X_C_Invoice implements DocAction
{
MInOutLine ioLine = new MInOutLine(getCtx(), iLine.getM_InOutLine_ID(), get_TrxName());
ioLine.setIsInvoiced(false);
ioLine.save(get_TrxName());
ioLine.saveEx(get_TrxName());
// Reconsiliation
iLine.setM_InOutLine_ID(0);
iLine.save(get_TrxName());
iLine.saveEx(get_TrxName());
}
}
setProcessed(true);

View File

@ -388,7 +388,7 @@ public class MMeasure extends X_PA_Measure
{
MGoal goal = goals[i];
goal.setMeasureActual(getManualActual());
goal.save(get_TrxName());
goal.saveEx(get_TrxName());
}
return true;
} // updateManualGoals
@ -431,7 +431,7 @@ public class MMeasure extends X_PA_Measure
}
}
goal.setMeasureActual(ManualActual);
goal.save(get_TrxName());
goal.saveEx(get_TrxName());
}
return true;
} // updateAchievementGoals
@ -478,7 +478,7 @@ public class MMeasure extends X_PA_Measure
log.fine("No Value = " + sql);
}
goal.setMeasureActual(ManualActual);
goal.save(get_TrxName());
goal.saveEx(get_TrxName());
}
return true;
} // updateCalculatedGoals
@ -532,7 +532,7 @@ public class MMeasure extends X_PA_Measure
log.fine("No Value = " + sql);
}
goal.setMeasureActual(ManualActual);
goal.save(get_TrxName());
goal.saveEx(get_TrxName());
}
return true;
} // updateRequests
@ -575,7 +575,7 @@ public class MMeasure extends X_PA_Measure
log.fine("No Value = " + sql);
}
goal.setMeasureActual(ManualActual);
goal.save(get_TrxName());
goal.saveEx(get_TrxName());
}
return true;
} // updateProjects
@ -659,7 +659,7 @@ public class MMeasure extends X_PA_Measure
}
}
goal.setMeasureActual(amt);
goal.save(get_TrxName());
goal.saveEx(get_TrxName());
}
return true;
} // updateUserDefinedGoals

View File

@ -634,7 +634,7 @@ public class MMovement extends X_M_Movement implements DocAction
{
line.setMovementQty(Env.ZERO);
line.addDescription("Void (" + old + ")");
line.save(get_TrxName());
line.saveEx(get_TrxName());
}
}
}

View File

@ -394,14 +394,14 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction
if (confirm.isFullyConfirmed())
{
confirm.setProcessed(true);
confirm.save(get_TrxName());
confirm.saveEx(get_TrxName());
}
else
{
if (createDifferenceDoc (move, confirm))
{
confirm.setProcessed(true);
confirm.save(get_TrxName());
confirm.saveEx(get_TrxName());
}
else
{

View File

@ -553,7 +553,7 @@ public class MOrder extends X_C_Order implements DocAction
if (counter)
{
fromLines[i].setRef_OrderLine_ID(line.getC_OrderLine_ID());
fromLines[i].save(get_TrxName());
fromLines[i].saveEx(get_TrxName());
}
}
if (fromLines.length != count)
@ -704,7 +704,7 @@ public class MOrder extends X_C_Order implements DocAction
{
MOrderLine line = lines[i];
line.setLine(number);
line.save(get_TrxName());
line.saveEx(get_TrxName());
number += step;
}
m_lines = null;
@ -892,7 +892,7 @@ public class MOrder extends X_C_Order implements DocAction
if (schedule[i].isValid() != valid)
{
schedule[i].setIsValid(valid);
schedule[i].save(get_TrxName());
schedule[i].saveEx(get_TrxName());
}
}
return valid;
@ -2061,7 +2061,7 @@ public class MOrder extends X_C_Order implements DocAction
counter.setDatePromised(getDatePromised()); // default is date ordered
// Refernces (Should not be required
counter.setSalesRep_ID(getSalesRep_ID());
counter.save(get_TrxName());
counter.saveEx(get_TrxName());
// Update copied lines
MOrderLine[] counterLines = counter.getLines(true, null);
@ -2071,7 +2071,7 @@ public class MOrder extends X_C_Order implements DocAction
counterLine.setOrder(counter); // copies header values (BP, etc.)
counterLine.setPrice();
counterLine.setTax();
counterLine.save(get_TrxName());
counterLine.saveEx(get_TrxName());
}
log.fine(counter.toString());
@ -2082,7 +2082,7 @@ public class MOrder extends X_C_Order implements DocAction
{
counter.setDocAction(counterDT.getDocAction());
counter.processIt(counterDT.getDocAction());
counter.save(get_TrxName());
counter.saveEx(get_TrxName());
}
}
return counter;
@ -2111,7 +2111,7 @@ public class MOrder extends X_C_Order implements DocAction
line.addDescription(Msg.getMsg(getCtx(), "Voided") + " (" + old + ")");
line.setQty(Env.ZERO);
line.setLineNetAmt(Env.ZERO);
line.save(get_TrxName());
line.saveEx(get_TrxName());
}
//AZ Goodwill
if (!isSOTrx())
@ -2199,7 +2199,7 @@ public class MOrder extends X_C_Order implements DocAction
return false;
}
ship.setDocAction(MInOut.DOCACTION_None);
ship.save(get_TrxName());
ship.saveEx(get_TrxName());
} // for all shipments
// Reverse All *Invoices*
@ -2232,7 +2232,7 @@ public class MOrder extends X_C_Order implements DocAction
return false;
}
invoice.setDocAction(MInvoice.DOCACTION_None);
invoice.save(get_TrxName());
invoice.saveEx(get_TrxName());
} // for all shipments
m_processMsg = info.toString();
@ -2265,7 +2265,7 @@ public class MOrder extends X_C_Order implements DocAction
line.setQtyOrdered(line.getQtyDelivered());
// QtyEntered unchanged
line.addDescription("Close (" + old + ")");
line.save(get_TrxName());
line.saveEx(get_TrxName());
}
}
// Clear Reservations

View File

@ -2379,7 +2379,7 @@ public final class MPayment extends X_C_Payment
reversal.closeIt();
reversal.setDocStatus(DOCSTATUS_Reversed);
reversal.setDocAction(DOCACTION_None);
reversal.save(get_TrxName());
reversal.saveEx(get_TrxName());
// Unlink & De-Allocate
deAllocate();
@ -2418,7 +2418,7 @@ public final class MPayment extends X_C_Payment
log.warning("Automatic allocation - reversal line not saved");
}
alloc.processIt(DocAction.ACTION_Complete);
alloc.save(get_TrxName());
alloc.saveEx(get_TrxName());
//
StringBuffer info = new StringBuffer (reversal.getDocumentNo());
info.append(" - @C_AllocationHdr_ID@: ").append(alloc.getDocumentNo());
@ -2428,7 +2428,7 @@ public final class MPayment extends X_C_Payment
{
MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName());
bp.setTotalOpenBalance();
bp.save(get_TrxName());
bp.saveEx(get_TrxName());
}
// After reverseCorrect
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);

View File

@ -166,7 +166,7 @@ public class MProductBOM extends X_M_Product_BOM
if (product.isVerified())
{
product.setIsVerified(false);
product.save(get_TrxName());
product.saveEx(get_TrxName());
}
// Invalidate Products where BOM is used

View File

@ -126,7 +126,7 @@ public class MRecurring extends X_C_Recurring
}
else
return "Invalid @RecurringType@ = " + getRecurringType();
run.save(get_TrxName());
run.saveEx(get_TrxName());
//
setDateLastRun (run.getUpdated());

View File

@ -486,7 +486,7 @@ public class MDDOrder extends X_DD_Order implements DocAction
{
MDDOrderLine line = lines[i];
line.setLine(number);
line.save(get_TrxName());
line.saveEx(get_TrxName());
number += step;
}
m_lines = null;
@ -1008,7 +1008,7 @@ public class MDDOrder extends X_DD_Order implements DocAction
if (old.signum() != 0)
{
line.addDescription(Msg.getMsg(getCtx(), "Voided") + " (" + old + ")");
line.save(get_TrxName());
line.saveEx(get_TrxName());
}
}
addDescription(Msg.getMsg(getCtx(), "Voided"));
@ -1133,7 +1133,7 @@ public class MDDOrder extends X_DD_Order implements DocAction
line.setQtyOrdered(line.getQtyDelivered());
// QtyEntered unchanged
line.addDescription("Close (" + old + ")");
line.save(get_TrxName());
line.saveEx(get_TrxName());
}
}
// Clear Reservations