Skip to content

Commit

Permalink
IDEMPIERE-5981 Misleading error when completing an auto-produce shipm…
Browse files Browse the repository at this point in the history
…ent (idempiere#2177)

* IDEMPIERE-5981 Misleading error when completing an auto-produce shipment

* - more robust fix
  • Loading branch information
CarlosRuiz-globalqss authored Jan 10, 2024
1 parent c976dab commit 7f7b31b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,14 @@ private String createProduction(MInOut mInOut, MInOutLine mInOutLine, BigDecimal
//complete the production
ProcessInfo pi = MWorkflow.runDocumentActionWorkflow(production, "CO");
if (pi.isError()) {
return production.getProcessMsg();
StringBuilder msgError = new StringBuilder();
if (!Util.isEmpty(pi.getSummary()))
msgError.append(pi.getSummary());
if (!Util.isEmpty(production.getProcessMsg()))
msgError.append(" - " ).append(production.getProcessMsg());
if (msgError.length() == 0) // unlikely to arrive here, but we need to ensure that issues is raised
msgError.append("Error completing auto-produce production");
return msgError.toString();
}
return null;
}
Expand Down

0 comments on commit 7f7b31b

Please sign in to comment.