use of com.axelor.apps.production.db.repo.ManufOrderRepository in project axelor-open-suite by axelor.
the class PurchaseOrderServiceProductionImpl method setMergedPurchaseOrderForManufOrder.
@SuppressWarnings("unchecked")
private void setMergedPurchaseOrderForManufOrder(PurchaseOrder mergedPurchaseOrder, List<PurchaseOrder> purchaseOrderList) {
AppProductionService appProductionService = Beans.get(AppProductionService.class);
if (appProductionService.isApp("production") && appProductionService.getAppProduction().getManageOutsourcing()) {
ManufOrderRepository manufOrderRepository = Beans.get(ManufOrderRepository.class);
for (PurchaseOrder purchaseOrder : purchaseOrderList) {
List<ManufOrder> manufOrderList = (List<ManufOrder>) manufOrderRepository.all().filter("self.purchaseOrder.id = ?1", purchaseOrder.getId());
for (ManufOrder manufOrder : manufOrderList) {
manufOrder.setPurchaseOrder(mergedPurchaseOrder);
manufOrderRepository.save(manufOrder);
}
}
}
}
Aggregations