diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index 70062232f9..07b6a240bf 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -52,6 +52,7 @@ import org.compiere.util.Trx; import org.compiere.util.TrxEventListener; import org.compiere.util.Util; import org.compiere.wf.MWFActivity; +import org.compiere.wf.MWorkflow; /** * Shipment Model @@ -2001,13 +2002,11 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess if (log.isLoggable(Level.FINE)) log.fine(dropShipment.toString()); - dropShipment.setDocAction(DocAction.ACTION_Complete); // do not post immediate dropshipment, should post after source shipment dropShipment.set_Attribute(DocumentEngine.DOCUMENT_POST_IMMEDIATE_AFTER_COMPLETE, Boolean.FALSE); - // added AdempiereException by Zuhri - if (!dropShipment.processIt(DocAction.ACTION_Complete)) - throw new AdempiereException(Msg.getMsg(getCtx(), "FailedProcessingDocument") + " - " + dropShipment.getProcessMsg()); - // end added + ProcessInfo processInfo = MWorkflow.runDocumentActionWorkflow(dropShipment, DocAction.ACTION_Complete); + if (processInfo.isError()) + throw new RuntimeException(Msg.getMsg(getCtx(), "FailedProcessingDocument") + ": " + dropShipment.toString() + " - " + dropShipment.getProcessMsg()); dropShipment.saveEx(); return dropShipment;