diff --git a/org.adempiere.base.process/src/org/compiere/process/CopyOrder.java b/org.adempiere.base.process/src/org/compiere/process/CopyOrder.java index aac140b7ab..e9f8bdf5b9 100644 --- a/org.adempiere.base.process/src/org/compiere/process/CopyOrder.java +++ b/org.adempiere.base.process/src/org/compiere/process/CopyOrder.java @@ -94,10 +94,19 @@ public class CopyOrder extends SvrProcess { MOrder original = new MOrder (getCtx(), p_C_Order_ID, get_TrxName()); original.setDocAction(MOrder.DOCACTION_Complete); - original.processIt(MOrder.DOCACTION_Complete); + if (!original.processIt(MOrder.DOCACTION_Complete)) { + log.warning("Order Process Failed: " + original.getDocumentNo() + " " + original.getProcessMsg()); + throw new IllegalStateException("Order Process Failed: " + original.getDocumentNo() + " " + original.getProcessMsg()); + + } original.saveEx(); original.setDocAction(MOrder.DOCACTION_Close); - original.processIt(MOrder.DOCACTION_Close); + if (!original.processIt(MOrder.DOCACTION_Close)) { + log.warning("Order Process Failed: " + original.getDocumentNo() + " " + original.getProcessMsg()); + throw new IllegalStateException("Order Process Failed: " + original.getDocumentNo() + " " + original.getProcessMsg()); + + } + original.saveEx(); } //