use of com.axelor.apps.supplychain.service.MrpService in project axelor-open-suite by axelor.
the class MrpController method runCalculation.
public void runCalculation(ActionRequest request, ActionResponse response) {
Mrp mrp = request.getContext().asType(Mrp.class);
MrpService mrpService = Beans.get(MrpService.class);
MrpRepository mrpRepository = Beans.get(MrpRepository.class);
try {
mrpService.runCalculation(mrpRepository.find(mrp.getId()));
} catch (Exception e) {
TraceBackService.trace(response, e);
mrpService.onError(mrpRepository.find(mrp.getId()), e);
} finally {
response.setReload(true);
}
}
use of com.axelor.apps.supplychain.service.MrpService in project axelor-open-suite by axelor.
the class MrpController method undoManualChanges.
public void undoManualChanges(ActionRequest request, ActionResponse response) {
Mrp mrp = request.getContext().asType(Mrp.class);
MrpService mrpService = Beans.get(MrpService.class);
MrpRepository mrpRepository = Beans.get(MrpRepository.class);
try {
mrpService.undoManualChanges(mrpRepository.find(mrp.getId()));
} catch (Exception e) {
TraceBackService.trace(response, e);
mrpService.reset(mrpRepository.find(mrp.getId()));
} finally {
response.setReload(true);
}
}
Aggregations