Search in sources :

Example 1 with StockLocationLineReservationService

use of com.axelor.apps.supplychain.service.StockLocationLineReservationService in project axelor-open-suite by axelor.

the class StockLocationLineController method deallocateAll.

/**
 * Called from stock location line form view, on deallocateAll button click. Call {@link
 * StockLocationLineReservationService#deallocateAll(StockLocationLine)}
 *
 * @param request
 * @param response
 */
public void deallocateAll(ActionRequest request, ActionResponse response) {
    try {
        StockLocationLine stockLocationLine = request.getContext().asType(StockLocationLine.class);
        stockLocationLine = Beans.get(StockLocationLineRepository.class).find(stockLocationLine.getId());
        Beans.get(StockLocationLineReservationService.class).deallocateAll(stockLocationLine);
        response.setReload(true);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : StockLocationLineReservationService(com.axelor.apps.supplychain.service.StockLocationLineReservationService) StockLocationLine(com.axelor.apps.stock.db.StockLocationLine)

Example 2 with StockLocationLineReservationService

use of com.axelor.apps.supplychain.service.StockLocationLineReservationService in project axelor-open-suite by axelor.

the class StockLocationLineController method allocateAll.

/**
 * Called from stock location line form view, on allocateAll button click. Call {@link
 * StockLocationLineReservationService#allocateAll(StockLocationLine)}
 *
 * @param request
 * @param response
 */
public void allocateAll(ActionRequest request, ActionResponse response) {
    try {
        StockLocationLine stockLocationLine = request.getContext().asType(StockLocationLine.class);
        stockLocationLine = Beans.get(StockLocationLineRepository.class).find(stockLocationLine.getId());
        Beans.get(StockLocationLineReservationService.class).allocateAll(stockLocationLine);
        response.setReload(true);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : StockLocationLineReservationService(com.axelor.apps.supplychain.service.StockLocationLineReservationService) StockLocationLine(com.axelor.apps.stock.db.StockLocationLine)

Aggregations

StockLocationLine (com.axelor.apps.stock.db.StockLocationLine)2 StockLocationLineReservationService (com.axelor.apps.supplychain.service.StockLocationLineReservationService)2