IDEMPIERE-5900 [AutoProcuce] - Execute only when it is not a return (#2080)

This commit is contained in:
Jose Leite 2023-10-31 09:00:59 -03:00 committed by GitHub
parent e99c5cc4ca
commit 286ec63012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -67,7 +67,11 @@ public class AutoProduceEventDelegate extends ModelEventDelegate<MInOut> {
@BeforeComplete @BeforeComplete
public void onBeforeComplete() { public void onBeforeComplete() {
MInOut mInOut = getModel(); MInOut mInOut = getModel();
if (mInOut.isSOTrx()) {
boolean isGenerateProduction = (!MInOut.MOVEMENTTYPE_CustomerReturns.equals(mInOut.getMovementType())
&& !MInOut.MOVEMENTTYPE_VendorReturns.equals(mInOut.getMovementType()));
if (mInOut.isSOTrx() && isGenerateProduction) {
String msg = processShipment(mInOut); String msg = processShipment(mInOut);
if (msg != null) if (msg != null)
throw new RuntimeException (msg); throw new RuntimeException (msg);