use of com.axelor.apps.production.db.ProdProcess in project axelor-open-suite by axelor.
the class ProdProcessService method generateNewVersion.
@Transactional
public ProdProcess generateNewVersion(ProdProcess prodProcess) {
ProdProcess copy = prodProcessRepo.copy(prodProcess, true);
copy.getProdProcessLineList().forEach(list -> list.setProdProcess(copy));
copy.setOriginalProdProcess(prodProcess);
copy.setVersionNumber(this.getLatestProdProcessVersion(prodProcess, prodProcess.getVersionNumber(), true) + 1);
return prodProcessRepo.save(copy);
}
use of com.axelor.apps.production.db.ProdProcess in project axelor-open-suite by axelor.
the class ProdProcessManagementRepository method copy.
@Override
public ProdProcess copy(ProdProcess entity, boolean deep) {
ProdProcess copy = super.copy(entity, deep);
copy.setStatusSelect(STATUS_DRAFT);
copy.setVersionNumber(1);
copy.setOriginalProdProcess(null);
return copy;
}
Aggregations