Search in sources :

Example 1 with SaleOrderService

use of com.axelor.apps.sale.service.saleorder.SaleOrderService in project axelor-open-suite by axelor.

the class SaleOrderController method validateChanges.

/**
 * Called from sale order form view, on clicking validate change button. Call {@link
 * SaleOrderService#validateChanges(SaleOrder)}.
 *
 * @param request
 * @param response
 */
public void validateChanges(ActionRequest request, ActionResponse response) {
    try {
        SaleOrder saleOrderView = request.getContext().asType(SaleOrder.class);
        SaleOrder saleOrder = Beans.get(SaleOrderRepository.class).find(saleOrderView.getId());
        Beans.get(SaleOrderService.class).validateChanges(saleOrder);
        response.setReload(true);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : SaleOrderService(com.axelor.apps.sale.service.saleorder.SaleOrderService) SaleOrderRepository(com.axelor.apps.sale.db.repo.SaleOrderRepository) SaleOrder(com.axelor.apps.sale.db.SaleOrder) BirtException(org.eclipse.birt.core.exception.BirtException) AxelorException(com.axelor.exception.AxelorException) IOException(java.io.IOException)

Aggregations

SaleOrder (com.axelor.apps.sale.db.SaleOrder)1 SaleOrderRepository (com.axelor.apps.sale.db.repo.SaleOrderRepository)1 SaleOrderService (com.axelor.apps.sale.service.saleorder.SaleOrderService)1 AxelorException (com.axelor.exception.AxelorException)1 IOException (java.io.IOException)1 BirtException (org.eclipse.birt.core.exception.BirtException)1