Search in sources :

Example 1 with SaleOrderServiceSupplychainImpl

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

the class SaleOrderController method onSave.

/**
 * Called from sale order on save. Call {@link
 * SaleOrderServiceSupplychainImpl#checkModifiedConfirmedOrder(SaleOrder, SaleOrder)}.
 *
 * @param request
 * @param response
 */
public void onSave(ActionRequest request, ActionResponse response) {
    try {
        SaleOrder saleOrderView = request.getContext().asType(SaleOrder.class);
        if (saleOrderView.getOrderBeingEdited()) {
            SaleOrder saleOrder = Beans.get(SaleOrderRepository.class).find(saleOrderView.getId());
            Beans.get(SaleOrderServiceSupplychainImpl.class).checkModifiedConfirmedOrder(saleOrder, saleOrderView);
            response.setValues(saleOrderView);
        }
    } catch (Exception e) {
        TraceBackService.trace(response, e, ResponseMessageType.ERROR);
    }
}
Also used : SaleOrderRepository(com.axelor.apps.sale.db.repo.SaleOrderRepository) SaleOrder(com.axelor.apps.sale.db.SaleOrder) SaleOrderServiceSupplychainImpl(com.axelor.apps.supplychain.service.SaleOrderServiceSupplychainImpl) AxelorException(com.axelor.exception.AxelorException)

Aggregations

SaleOrder (com.axelor.apps.sale.db.SaleOrder)1 SaleOrderRepository (com.axelor.apps.sale.db.repo.SaleOrderRepository)1 SaleOrderServiceSupplychainImpl (com.axelor.apps.supplychain.service.SaleOrderServiceSupplychainImpl)1 AxelorException (com.axelor.exception.AxelorException)1