Skip to content

Commit

Permalink
Not all picking slots are released (#17819)
Browse files Browse the repository at this point in the history
refs: #17813
  • Loading branch information
cp-ps committed Apr 10, 2024
1 parent fc413c1 commit 9b3714a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public void validatePickingSlot(@NonNull final DataTable dataTable)
softAssertions.assertThat(pickingSlot.getC_BPartner_Location_ID()).isEqualTo(0);
}
});

softAssertions.assertAll();
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ Feature: Picking workflow - abort not started picking jobs after shipment
When 'generate shipments' process is invoked
| M_ShipmentSchedule_ID.Identifier | QuantityType | IsCompleteShipments | IsShipToday |
| pickingShipmentSchedule | D | true | false |
And after not more than 60s, M_InOut is found:
| M_ShipmentSchedule_ID.Identifier | M_InOut_ID.Identifier |
| pickingShipmentSchedule | s_1 |
Then validate M_PickingSlot:
| M_PickingSlot_ID.Identifier | IsAllocated |
| 170.0 | N |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import lombok.RequiredArgsConstructor;
import org.adempiere.ad.modelvalidator.annotations.DocValidate;
import org.adempiere.ad.modelvalidator.annotations.Interceptor;
import org.adempiere.ad.trx.api.ITrxManager;
import org.compiere.model.I_M_InOut;
import org.compiere.model.ModelValidator;
import org.springframework.stereotype.Component;
Expand All @@ -39,12 +40,15 @@
public class M_InOut
{
private final IShipmentScheduleAllocDAO shipmentScheduleAllocDAO = Services.get(IShipmentScheduleAllocDAO.class);
private final ITrxManager trxManager = Services.get(ITrxManager.class);


private final PickingJobService pickingJobService;

@DocValidate(timings = ModelValidator.TIMING_AFTER_COMPLETE)
public void afterComplete(@NonNull final I_M_InOut shipment)
{
shipmentScheduleAllocDAO.retrieveOrderIds(shipment).forEach(pickingJobService::abortNotStartedForSalesOrderId);
trxManager.runAfterCommit(() -> shipmentScheduleAllocDAO.retrieveOrderIds(shipment)
.forEach(pickingJobService::abortNotStartedForSalesOrderId));
}
}

0 comments on commit 9b3714a

Please sign in to comment.