Search in sources :

Example 1 with PackLineService

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

the class PackLineController method getProductInformation.

public void getProductInformation(ActionRequest request, ActionResponse response) {
    Context context = request.getContext();
    PackLine packLine = context.asType(PackLine.class);
    Pack pack = this.getPack(context);
    Product product = packLine.getProduct();
    PackLineService packLineService = Beans.get(PackLineService.class);
    if (product == null) {
        packLine = packLineService.resetProductInformation(packLine);
        response.setValues(packLine);
        return;
    }
    try {
        packLine = packLineService.computeProductInformation(pack, packLine);
        response.setValues(packLine);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : Context(com.axelor.rpc.Context) Product(com.axelor.apps.base.db.Product) Pack(com.axelor.apps.sale.db.Pack) PackLineService(com.axelor.apps.sale.service.PackLineService) PackLine(com.axelor.apps.sale.db.PackLine)

Aggregations

Product (com.axelor.apps.base.db.Product)1 Pack (com.axelor.apps.sale.db.Pack)1 PackLine (com.axelor.apps.sale.db.PackLine)1 PackLineService (com.axelor.apps.sale.service.PackLineService)1 Context (com.axelor.rpc.Context)1