Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not all picking slots are released (#17819) #17823

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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));
}
}
Loading