From 7e0202eedbca3bc2979cb551005dc7dfd70fc221 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 9 Feb 2023 16:37:22 +0100 Subject: [PATCH] IDEMPIERE-5571 Shipment created by Drop Ship Material Receipt is not processing workflows (#1667) --- org.adempiere.base/src/org/compiere/model/MInOut.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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;