From 55e074dc5e04526c3a8034db3193c0da47189d0c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 31 Mar 2017 18:29:53 +0200 Subject: [PATCH] IDEMPIERE-37 Make iDempiere safer using saveEx instead of save / found and fix more cases using save - or ignoring the error of save --- .../org/compiere/process/DunningPrint.java | 2 +- .../org/compiere/process/ImportInvoice.java | 2 +- .../src/org/compiere/process/ImportOrder.java | 2 +- .../org/compiere/process/ProjectGenPO.java | 2 +- .../compiere/process/TableCreateColumns.java | 2 +- .../base/event/RequestEventHandler.java | 4 +- .../model/ProductPriceValidator.java | 2 +- .../src/org/compiere/cm/TemplateValidate.java | 2 +- .../src/org/compiere/cm/WebProjectDeploy.java | 2 +- .../compiere/model/AttachmentFileSystem.java | 2 +- .../src/org/compiere/model/MCalendar.java | 4 +- .../src/org/compiere/model/MCash.java | 2 +- .../src/org/compiere/model/MContainer.java | 6 +-- .../org/compiere/model/MDunningRunEntry.java | 2 +- .../src/org/compiere/model/MInOut.java | 6 +-- .../src/org/compiere/model/MInvoice.java | 40 +++++++++---------- .../org/compiere/model/MLdapProcessor.java | 2 +- .../org/compiere/model/MMovementConfirm.java | 2 +- .../src/org/compiere/model/MOrder.java | 6 +-- .../src/org/compiere/model/MPackage.java | 2 +- .../src/org/compiere/model/MPaymentTerm.java | 8 ++-- .../src/org/compiere/model/MPeriod.java | 4 +- .../src/org/compiere/model/MProject.java | 12 +++--- .../src/org/compiere/model/MProjectPhase.java | 13 +++--- .../src/org/compiere/model/MProjectTask.java | 4 +- .../src/org/compiere/util/WebLogin.java | 2 +- .../src/org/compiere/util/WebUser.java | 2 +- .../fa/process/ImportFixedAsset.java | 4 +- .../compiere/grid/ed/VPAttributeDialog.java | 4 +- .../adempiere/webui/process/DunningPrint.java | 2 +- .../webui/window/WPAttributeDialog.java | 4 +- .../org/compiere/apps/form/Allocation.java | 2 +- .../src/org/compiere/wstore/AssetServlet.java | 2 +- .../org/compiere/wstore/PaymentServlet.java | 2 +- 34 files changed, 77 insertions(+), 82 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java b/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java index 835bfddee6..484a55f868 100644 --- a/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java +++ b/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java @@ -232,7 +232,7 @@ public class DunningPrint extends SvrProcess if (printed) { entry.setProcessed (true); - entry.save (); + entry.saveEx(); } } // for all dunning letters diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java b/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java index 137b6fc424..efd6608de1 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java @@ -609,7 +609,7 @@ public class ImportInvoice extends SvrProcess imp.setAD_User_ID (user.getAD_User_ID ()); } } - imp.save (); + imp.saveEx(); } // for all new BPartners // } diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java b/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java index 4f1c6347c2..386d42c713 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java @@ -610,7 +610,7 @@ public class ImportOrder extends SvrProcess imp.setAD_User_ID (user.getAD_User_ID ()); } } - imp.save (); + imp.saveEx(); } // for all new BPartners // } diff --git a/org.adempiere.base.process/src/org/compiere/process/ProjectGenPO.java b/org.adempiere.base.process/src/org/compiere/process/ProjectGenPO.java index 6ae8c3a22c..08df541ede 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ProjectGenPO.java +++ b/org.adempiere.base.process/src/org/compiere/process/ProjectGenPO.java @@ -161,7 +161,7 @@ public class ProjectGenPO extends SvrProcess } order.setClientOrg (projectLine.getAD_Client_ID (), AD_Org_ID); order.setBPartner (bp); - order.save (); + order.saveEx(); // optionally save for consolidation if (m_ConsolidateDocument) m_pos.add(order); diff --git a/org.adempiere.base.process/src/org/compiere/process/TableCreateColumns.java b/org.adempiere.base.process/src/org/compiere/process/TableCreateColumns.java index 73a67dd5d9..445d30692d 100644 --- a/org.adempiere.base.process/src/org/compiere/process/TableCreateColumns.java +++ b/org.adempiere.base.process/src/org/compiere/process/TableCreateColumns.java @@ -258,7 +258,7 @@ public class TableCreateColumns extends SvrProcess element.setName(uuidColumn); element.setPrintName(uuidColumn); } - element.save (); + element.saveEx(); } column.setColumnName (element.getColumnName ()); column.setName (element.getName ()); diff --git a/org.adempiere.base/src/org/adempiere/base/event/RequestEventHandler.java b/org.adempiere.base/src/org/adempiere/base/event/RequestEventHandler.java index d961215868..1db37f7c96 100644 --- a/org.adempiere.base/src/org/adempiere/base/event/RequestEventHandler.java +++ b/org.adempiere.base/src/org/adempiere/base/event/RequestEventHandler.java @@ -67,7 +67,7 @@ public class RequestEventHandler extends AbstractEventHandler implements Managed MNote note = new MNote(Env.getCtx(), AD_Message_ID, eventData.getTo().getAD_User_ID(), X_R_Request.Table_ID, eventData.getRequestID(), eventData.getSubject(), eventData.getMessage(), null); - note.save(); + note.saveEx(); } } else if (topic.equals(IEventTopics.PO_BEFORE_NEW) || topic.equals(IEventTopics.PO_BEFORE_CHANGE) @@ -390,7 +390,7 @@ public class RequestEventHandler extends AbstractEventHandler implements Managed MNote note = new MNote(r.getCtx(), AD_Message_ID, AD_User_ID, X_R_Request.Table_ID, r.getR_Request_ID(), subject, message.toString(), r.get_TrxName()); - note.save(); + note.saveEx(); } } } diff --git a/org.adempiere.base/src/org/adempiere/model/ProductPriceValidator.java b/org.adempiere.base/src/org/adempiere/model/ProductPriceValidator.java index fad0de8a46..66f0281df9 100644 --- a/org.adempiere.base/src/org/adempiere/model/ProductPriceValidator.java +++ b/org.adempiere.base/src/org/adempiere/model/ProductPriceValidator.java @@ -108,7 +108,7 @@ public class ProductPriceValidator implements ModelValidator { { pp1.setPrices(priceList, priceStd, priceLimit); pp1.setIsActive(isActive); - pp1.save(po.get_TrxName()); + pp1.saveEx(po.get_TrxName()); } } else if (type == TYPE_AFTER_DELETE) diff --git a/org.adempiere.base/src/org/compiere/cm/TemplateValidate.java b/org.adempiere.base/src/org/compiere/cm/TemplateValidate.java index 2e7f2ef5a9..97810fb92a 100644 --- a/org.adempiere.base/src/org/compiere/cm/TemplateValidate.java +++ b/org.adempiere.base/src/org/compiere/cm/TemplateValidate.java @@ -52,7 +52,7 @@ public class TemplateValidate extends SvrProcess { MTemplate thisTemplate = new MTemplate(getCtx (), getRecord_ID (), get_TrxName ()); thisTemplate.setIsValid (true); - thisTemplate.save (); + thisTemplate.saveEx(); return null; } diff --git a/org.adempiere.base/src/org/compiere/cm/WebProjectDeploy.java b/org.adempiere.base/src/org/compiere/cm/WebProjectDeploy.java index 440510991e..5ab1d0cba3 100644 --- a/org.adempiere.base/src/org/compiere/cm/WebProjectDeploy.java +++ b/org.adempiere.base/src/org/compiere/cm/WebProjectDeploy.java @@ -184,7 +184,7 @@ public class WebProjectDeploy extends SvrProcess thisHandler.cleanContainer(cc.get_ID()); // Reset Modified flag... stage.setIsModified(false); - stage.save(stage.get_TrxName()); + stage.saveEx(stage.get_TrxName()); } if (child.isSummary()) copyStage (child, path + stage.getRelativeURL() + "/"); diff --git a/org.adempiere.base/src/org/compiere/model/AttachmentFileSystem.java b/org.adempiere.base/src/org/compiere/model/AttachmentFileSystem.java index 9ed901f58c..f4d241408a 100644 --- a/org.adempiere.base/src/org/compiere/model/AttachmentFileSystem.java +++ b/org.adempiere.base/src/org/compiere/model/AttachmentFileSystem.java @@ -277,7 +277,7 @@ public class AttachmentFileSystem implements IAttachmentStore { } } attach.m_items.remove(index); - attach.save(); // must save here as the operation cannot be rolled back on filesystem + attach.saveEx(); // must save here as the operation cannot be rolled back on filesystem if (log.isLoggable(Level.CONFIG)) log.config("Index=" + index + " - NewSize=" + attach.m_items.size()); return true; } diff --git a/org.adempiere.base/src/org/compiere/model/MCalendar.java b/org.adempiere.base/src/org/compiere/model/MCalendar.java index f471f05e31..2f20ef7649 100644 --- a/org.adempiere.base/src/org/compiere/model/MCalendar.java +++ b/org.adempiere.base/src/org/compiere/model/MCalendar.java @@ -127,8 +127,8 @@ public class MCalendar extends X_C_Calendar if (get_ID() == 0) return null; MYear year = new MYear (this); - if (year.save()) - year.createStdPeriods(locale); + year.saveEx(); + year.createStdPeriods(locale); // return year; } // createYear diff --git a/org.adempiere.base/src/org/compiere/model/MCash.java b/org.adempiere.base/src/org/compiere/model/MCash.java index a8d2e162fb..289be65292 100644 --- a/org.adempiere.base/src/org/compiere/model/MCash.java +++ b/org.adempiere.base/src/org/compiere/model/MCash.java @@ -94,7 +94,7 @@ public class MCash extends X_C_Cash implements DocAction // Create New Journal retValue = new MCash (cb, dateAcct); - retValue.save(trxName); + retValue.saveEx(trxName); return retValue; } // get diff --git a/org.adempiere.base/src/org/compiere/model/MContainer.java b/org.adempiere.base/src/org/compiere/model/MContainer.java index 400003fb02..8406315fc3 100644 --- a/org.adempiere.base/src/org/compiere/model/MContainer.java +++ b/org.adempiere.base/src/org/compiere/model/MContainer.java @@ -93,7 +93,7 @@ public class MContainer extends X_CM_Container if (cc == null) // new cc = new MContainer (stage.getCtx (), 0, stage.get_TrxName ()); cc.setStage (project, stage, path); - cc.save (); + cc.saveEx(); if (!stage.isSummary ()) { cc.updateElements (project, stage, stage.get_TrxName ()); @@ -315,7 +315,7 @@ public class MContainer extends X_CM_Container // PO.copyValues(new // X_CM_CStage_Element(project.getCtx(),tableKeys[i],trxName), // thisContainerElement); - thisContainerElement.save (trxName); + thisContainerElement.saveEx(trxName); // Remove Container from cache thisHandler.cleanContainerElement (thisContainerElement .get_ID ()); @@ -391,7 +391,7 @@ public class MContainer extends X_CM_Container thisContainerTTable.setCM_Container_ID (stage.get_ID ()); PO.copyValues (new X_CM_CStageTTable (project.getCtx (), tableKeys[i], trxName), thisContainerTTable); - thisContainerTTable.save (trxName); + thisContainerTTable.saveEx(trxName); } } } diff --git a/org.adempiere.base/src/org/compiere/model/MDunningRunEntry.java b/org.adempiere.base/src/org/compiere/model/MDunningRunEntry.java index 40b603b749..923f13a8b1 100644 --- a/org.adempiere.base/src/org/compiere/model/MDunningRunEntry.java +++ b/org.adempiere.base/src/org/compiere/model/MDunningRunEntry.java @@ -295,7 +295,7 @@ public class MDunningRunEntry extends X_C_DunningRunEntry thisBPartner.setSOCreditStatus (X_C_BPartner.SOCREDITSTATUS_CreditStop); if (level.isSetPaymentTerm ()) thisBPartner.setC_PaymentTerm_ID (level.getC_PaymentTerm_ID ()); - thisBPartner.save (); + thisBPartner.saveEx(); } } return true; diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index bd5b1220a0..d21cdc948b 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -132,7 +132,7 @@ public class MInOut extends X_M_InOut implements DocAction } // Create Line if (retValue.get_ID() == 0) // not saved yet - retValue.save(trxName); + retValue.saveEx(trxName); // Create a line until qty is reached for (int ll = 0; ll < storages.length; ll++) { @@ -148,11 +148,11 @@ public class MInOut extends X_M_InOut implements DocAction .multiply(oLines[i].getQtyEntered()) .divide(oLines[i].getQtyOrdered(), 12, BigDecimal.ROUND_HALF_UP)); line.setC_Project_ID(oLines[i].getC_Project_ID()); - line.save(trxName); + line.saveEx(trxName); // Delivered everything ? qty = qty.subtract(lineQty); // storage[ll].changeQtyOnHand(lineQty, !order.isSOTrx()); // Credit Memo not considered - // storage[ll].save(get_TrxName()); + // storage[ll].saveEx(get_TrxName()); if (qty.signum() == 0) break; } diff --git a/org.adempiere.base/src/org/compiere/model/MInvoice.java b/org.adempiere.base/src/org/compiere/model/MInvoice.java index 32e4d1411e..09c164e598 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoice.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoice.java @@ -1581,7 +1581,7 @@ public class MInvoice extends X_C_Invoice implements DocAction if (bom.getDescription() != null) newLine.setDescription(bom.getDescription()); newLine.setPrice(); - newLine.save(get_TrxName()); + newLine.saveEx(get_TrxName()); } // Convert into Comment Line @@ -2506,28 +2506,26 @@ public class MInvoice extends X_C_Invoice implements DocAction msgall.toString(), get_TrxName()); alloc.setAD_Org_ID(getAD_Org_ID()); - if (alloc.save()) - { - // Amount - BigDecimal gt = getGrandTotal(true); - if (!isSOTrx()) - gt = gt.negate(); - // Orig Line - MAllocationLine aLine = new MAllocationLine (alloc, gt, + alloc.saveEx(); + // Amount + BigDecimal gt = getGrandTotal(true); + if (!isSOTrx()) + gt = gt.negate(); + // Orig Line + MAllocationLine aLine = new MAllocationLine (alloc, gt, Env.ZERO, Env.ZERO, Env.ZERO); - aLine.setC_Invoice_ID(getC_Invoice_ID()); - aLine.saveEx(); - // Reversal Line - MAllocationLine rLine = new MAllocationLine (alloc, gt.negate(), + aLine.setC_Invoice_ID(getC_Invoice_ID()); + aLine.saveEx(); + // Reversal Line + MAllocationLine rLine = new MAllocationLine (alloc, gt.negate(), Env.ZERO, Env.ZERO, Env.ZERO); - rLine.setC_Invoice_ID(reversal.getC_Invoice_ID()); - rLine.saveEx(); - // added AdempiereException by zuhri - if (!alloc.processIt(DocAction.ACTION_Complete)) - throw new AdempiereException("Failed when processing document - " + alloc.getProcessMsg()); - // end added - alloc.saveEx(); - } + rLine.setC_Invoice_ID(reversal.getC_Invoice_ID()); + rLine.saveEx(); + // added AdempiereException by zuhri + if (!alloc.processIt(DocAction.ACTION_Complete)) + throw new AdempiereException("Failed when processing document - " + alloc.getProcessMsg()); + // end added + alloc.saveEx(); return reversal; } diff --git a/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java b/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java index 6d7ae97c48..4765b626e7 100755 --- a/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MLdapProcessor.java @@ -522,7 +522,7 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce access.setR_InterestArea_ID (R_InterestArea_ID); access.setIsError (error != null); access.setSummary (info); - access.save (); + access.saveEx(); } // logAccess @Override diff --git a/org.adempiere.base/src/org/compiere/model/MMovementConfirm.java b/org.adempiere.base/src/org/compiere/model/MMovementConfirm.java index 0d30f27fb9..05c415716e 100644 --- a/org.adempiere.base/src/org/compiere/model/MMovementConfirm.java +++ b/org.adempiere.base/src/org/compiere/model/MMovementConfirm.java @@ -72,7 +72,7 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction } MMovementConfirm confirm = new MMovementConfirm (move); - confirm.save(move.get_TrxName()); + confirm.saveEx(move.get_TrxName()); MMovementLine[] moveLines = move.getLines(false); for (int i = 0; i < moveLines.length; i++) { diff --git a/org.adempiere.base/src/org/compiere/model/MOrder.java b/org.adempiere.base/src/org/compiere/model/MOrder.java index 28cb72b44b..ed7a0e1021 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrder.java +++ b/org.adempiere.base/src/org/compiere/model/MOrder.java @@ -1620,7 +1620,7 @@ public class MOrder extends X_C_Order implements DocAction newLine.setDescription (bomline.getDescription ()); // newLine.setPrice (); - newLine.save (get_TrxName()); + newLine.saveEx(get_TrxName()); } } */ @@ -1633,7 +1633,7 @@ public class MOrder extends X_C_Order implements DocAction if (bom.getDescription() != null) newLine.setDescription(bom.getDescription()); newLine.setPrice(); - newLine.save(get_TrxName()); + newLine.saveEx(get_TrxName()); } // Convert into Comment Line @@ -1651,7 +1651,7 @@ public class MOrder extends X_C_Order implements DocAction if (line.getDescription () != null) description += " " + line.getDescription (); line.setDescription (description); - line.save (get_TrxName()); + line.saveEx(get_TrxName()); } // for all lines with BOM m_lines = null; // force requery diff --git a/org.adempiere.base/src/org/compiere/model/MPackage.java b/org.adempiere.base/src/org/compiere/model/MPackage.java index 49b072d470..fb7ec4b266 100644 --- a/org.adempiere.base/src/org/compiere/model/MPackage.java +++ b/org.adempiere.base/src/org/compiere/model/MPackage.java @@ -93,7 +93,7 @@ public class MPackage extends X_M_Package } // lines retValue.setBoxCount(1); - retValue.save(); + retValue.saveEx(); return retValue; } // create diff --git a/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java b/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java index 3c1946d6b0..e20e35f719 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java +++ b/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java @@ -248,7 +248,7 @@ public class MPaymentTerm extends X_C_PaymentTerm for (int i = 0; i < m_schedule.length; i++) { ips = new MInvoicePaySchedule (invoice, m_schedule[i]); - ips.save(invoice.get_TrxName()); + ips.saveEx(invoice.get_TrxName()); if (log.isLoggable(Level.FINE)) log.fine(ips.toString()); remainder = remainder.subtract(ips.getDueAmt()); } // for all schedules @@ -256,7 +256,7 @@ public class MPaymentTerm extends X_C_PaymentTerm if (remainder.compareTo(Env.ZERO) != 0 && ips != null) { ips.setDueAmt(ips.getDueAmt().add(remainder)); - ips.save(invoice.get_TrxName()); + ips.saveEx(invoice.get_TrxName()); if (log.isLoggable(Level.FINE)) log.fine("Remainder=" + remainder + " - " + ips); } @@ -357,7 +357,7 @@ public class MPaymentTerm extends X_C_PaymentTerm for (int i = 0; i < m_schedule.length; i++) { ops = new MOrderPaySchedule (order, m_schedule[i]); - ops.save(order.get_TrxName()); + ops.saveEx(order.get_TrxName()); if (log.isLoggable(Level.FINE)) log.fine(ops.toString()); remainder = remainder.subtract(ops.getDueAmt()); } // for all schedules @@ -365,7 +365,7 @@ public class MPaymentTerm extends X_C_PaymentTerm if (remainder.compareTo(Env.ZERO) != 0 && ops != null) { ops.setDueAmt(ops.getDueAmt().add(remainder)); - ops.save(order.get_TrxName()); + ops.saveEx(order.get_TrxName()); if (log.isLoggable(Level.FINE)) log.fine("Remainder=" + remainder + " - " + ops); } diff --git a/org.adempiere.base/src/org/compiere/model/MPeriod.java b/org.adempiere.base/src/org/compiere/model/MPeriod.java index 9497281ad4..ba70fe56da 100644 --- a/org.adempiere.base/src/org/compiere/model/MPeriod.java +++ b/org.adempiere.base/src/org/compiere/model/MPeriod.java @@ -741,8 +741,8 @@ public class MPeriod extends X_C_Period if (baseTypes.contains(DocBaseType)) continue; MPeriodControl pc = new MPeriodControl(this, DocBaseType); - if (pc.save()) - count++; + pc.saveEx(); + count++; baseTypes.add (DocBaseType); } if (log.isLoggable(Level.FINE)) log.fine("PeriodControl #" + count); diff --git a/org.adempiere.base/src/org/compiere/model/MProject.java b/org.adempiere.base/src/org/compiere/model/MProject.java index 7bd1c3cfe4..cd9af41767 100644 --- a/org.adempiere.base/src/org/compiere/model/MProject.java +++ b/org.adempiere.base/src/org/compiere/model/MProject.java @@ -358,13 +358,11 @@ public class MProject extends X_C_Project toPhase.setC_Project_ID (getC_Project_ID ()); toPhase.setC_Order_ID (0); toPhase.setIsComplete (false); - if (toPhase.save ()) - { - count++; - taskCount += toPhase.copyTasksFrom (fromPhases[i]); - //BF 3067850 - monhate - lineCount += toPhase.copyLinesFrom(fromPhases[i]); - } + toPhase.saveEx(); + count++; + taskCount += toPhase.copyTasksFrom (fromPhases[i]); + //BF 3067850 - monhate + lineCount += toPhase.copyLinesFrom(fromPhases[i]); } } if (fromPhases.length != count) diff --git a/org.adempiere.base/src/org/compiere/model/MProjectPhase.java b/org.adempiere.base/src/org/compiere/model/MProjectPhase.java index 9a966115bc..5ecd16ffc6 100644 --- a/org.adempiere.base/src/org/compiere/model/MProjectPhase.java +++ b/org.adempiere.base/src/org/compiere/model/MProjectPhase.java @@ -159,8 +159,8 @@ public class MProjectPhase extends X_C_ProjectPhase PO.copyValues (fromLines[i], toLine, getAD_Client_ID (), getAD_Org_ID ()); toLine.setC_Project_ID(getC_Project_ID ()); toLine.setC_ProjectPhase_ID (getC_ProjectPhase_ID ()); - if (toLine.save ()) - count++; + toLine.saveEx(); + count++; } if (fromLines.length != count) log.warning("Count difference - ProjectLine=" + fromLines.length + " <> Saved=" + count); @@ -209,11 +209,10 @@ public class MProjectPhase extends X_C_ProjectPhase MProjectTask toTask = new MProjectTask (getCtx (), 0, get_TrxName()); PO.copyValues (fromTasks[i], toTask, getAD_Client_ID (), getAD_Org_ID ()); toTask.setC_ProjectPhase_ID (getC_ProjectPhase_ID ()); - if (toTask.save ()){ - count++; - //BF 3067850 - monhate - countLine += toTask.copyLinesFrom(fromTasks[i]); - } + toTask.saveEx(); + count++; + //BF 3067850 - monhate + countLine += toTask.copyLinesFrom(fromTasks[i]); } } if (fromTasks.length != count) diff --git a/org.adempiere.base/src/org/compiere/model/MProjectTask.java b/org.adempiere.base/src/org/compiere/model/MProjectTask.java index 172effcca2..38804b84cd 100644 --- a/org.adempiere.base/src/org/compiere/model/MProjectTask.java +++ b/org.adempiere.base/src/org/compiere/model/MProjectTask.java @@ -134,8 +134,8 @@ public class MProjectTask extends X_C_ProjectTask toLine.setC_Project_ID(getC_Project_ID(false)); toLine.setC_ProjectPhase_ID (getC_ProjectPhase_ID ()); toLine.setC_ProjectTask_ID(getC_ProjectTask_ID ()); - if (toLine.save ()) - count++; + toLine.saveEx(); + count++; } if (fromLines.length != count) log.warning("Count difference - ProjectLine=" + fromLines.length + " <> Saved=" + count); diff --git a/org.adempiere.base/src/org/compiere/util/WebLogin.java b/org.adempiere.base/src/org/compiere/util/WebLogin.java index 9026245e21..78e157159e 100644 --- a/org.adempiere.base/src/org/compiere/util/WebLogin.java +++ b/org.adempiere.base/src/org/compiere/util/WebLogin.java @@ -466,7 +466,7 @@ public class WebLogin thisBPBankAccount.setA_Name (WebUtil.getParamOrNull (m_request, "A_Name")); thisBPBankAccount.setAccountNo (WebUtil.getParamOrNull (m_request, "AccountNo")); thisBPBankAccount.setRoutingNo (WebUtil.getParamOrNull (m_request, "RoutingNo")); - thisBPBankAccount.save (); + thisBPBankAccount.saveEx(); } else log.log(Level.WARNING, "Unknown request='" + m_mode + "'"); diff --git a/org.adempiere.base/src/org/compiere/util/WebUser.java b/org.adempiere.base/src/org/compiere/util/WebUser.java index 94ee629dfe..98a8b3f2cb 100644 --- a/org.adempiere.base/src/org/compiere/util/WebUser.java +++ b/org.adempiere.base/src/org/compiere/util/WebUser.java @@ -488,7 +488,7 @@ public class WebUser // save Location *************************************** if (log.isLoggable(Level.FINE)) log.fine("LOC=" + m_loc); - m_loc.save (); + m_loc.saveEx(); // save BP Location *************************************** if (m_bpl.getC_BPartner_ID () != m_bp.getC_BPartner_ID()) diff --git a/org.adempiere.base/src/org/idempiere/fa/process/ImportFixedAsset.java b/org.adempiere.base/src/org/idempiere/fa/process/ImportFixedAsset.java index c2d1a0e88f..374fdaf68c 100644 --- a/org.adempiere.base/src/org/idempiere/fa/process/ImportFixedAsset.java +++ b/org.adempiere.base/src/org/idempiere/fa/process/ImportFixedAsset.java @@ -253,7 +253,7 @@ public class ImportFixedAsset extends SvrProcess if (!bpl.save ()) continue; } - ifa.save (); + ifa.saveEx(); } // for all new BPartners rs.close (); pstmt.close (); @@ -311,7 +311,7 @@ public class ImportFixedAsset extends SvrProcess } ifa.setM_Product_ID (product.getM_Product_ID()); - ifa.save (); + ifa.saveEx(); } // for all new Products rs.close (); pstmt.close (); diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttributeDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttributeDialog.java index 124b4c3e99..2f8b5cca3c 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttributeDialog.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttributeDialog.java @@ -746,7 +746,7 @@ public class VPAttributeDialog extends CDialog // New Instance if (m_changed || m_masi.getM_AttributeSetInstance_ID() == 0) { - m_masi.save (); + m_masi.saveEx(); m_M_AttributeSetInstance_ID = m_masi.getM_AttributeSetInstance_ID (); m_M_AttributeSetInstanceName = m_masi.getDescription(); } @@ -789,7 +789,7 @@ public class VPAttributeDialog extends CDialog if (m_changed) { m_masi.setDescription (); - m_masi.save (); + m_masi.saveEx(); } m_M_AttributeSetInstance_ID = m_masi.getM_AttributeSetInstance_ID (); m_M_AttributeSetInstanceName = m_masi.getDescription(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/DunningPrint.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/DunningPrint.java index df2cc725a2..21f1567fb5 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/DunningPrint.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/DunningPrint.java @@ -245,7 +245,7 @@ public class DunningPrint extends SvrProcess if (printed) { entry.setProcessed (true); - entry.save (); + entry.saveEx(); } } // for all dunning letters diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPAttributeDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPAttributeDialog.java index 71636e6e97..c0469b05bf 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPAttributeDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPAttributeDialog.java @@ -979,7 +979,7 @@ public class WPAttributeDialog extends Window implements EventListener // New Instance if (m_changed || m_masi.getM_AttributeSetInstance_ID() == 0) { - m_masi.save (); + m_masi.saveEx(); m_M_AttributeSetInstance_ID = m_masi.getM_AttributeSetInstance_ID (); m_M_AttributeSetInstanceName = m_masi.getDescription(); } @@ -1026,7 +1026,7 @@ public class WPAttributeDialog extends Window implements EventListener if (m_changed) { m_masi.setDescription (); - m_masi.save (); + m_masi.saveEx(); } m_M_AttributeSetInstance_ID = m_masi.getM_AttributeSetInstance_ID (); m_M_AttributeSetInstanceName = m_masi.getDescription(); diff --git a/org.adempiere.ui/src/org/compiere/apps/form/Allocation.java b/org.adempiere.ui/src/org/compiere/apps/form/Allocation.java index db59e1f6db..46f989b93e 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/Allocation.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/Allocation.java @@ -810,7 +810,7 @@ public class Allocation } MBPartner bpartner = new MBPartner(Env.getCtx(), m_C_BPartner_ID, trxName); bpartner.setTotalOpenBalance(); - bpartner.save(); + bpartner.saveEx(); paymentList.clear(); amountList.clear(); diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/AssetServlet.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/AssetServlet.java index 7e9a94e581..c338276952 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/AssetServlet.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/AssetServlet.java @@ -323,7 +323,7 @@ public class AssetServlet extends HttpServlet if (msg.length () > 120) msg = msg.substring (0, 119); ad.setDeliveryConfirmation (msg); - ad.save (); + ad.saveEx(); // asset.saveEx(); not delivered } catch (Exception ex1) diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/PaymentServlet.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/PaymentServlet.java index 1db1d725b7..8858beda05 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/PaymentServlet.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/PaymentServlet.java @@ -294,7 +294,7 @@ public class PaymentServlet extends HttpServlet { if (log.isLoggable(Level.FINE)) log.fine(payment.getErrorMessage()); String errMsg = payment.getErrorMessage(); - payment.save (); + payment.saveEx(); payment.setErrorMessage(errMsg); request.getSession().setAttribute(WebSessionCtx.HDR_MESSAGE, errMsg); //