Search in sources :

Example 11 with ProdProcess

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);
}
Also used : ProdProcess(com.axelor.apps.production.db.ProdProcess) Transactional(com.google.inject.persist.Transactional)

Example 12 with ProdProcess

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;
}
Also used : ProdProcess(com.axelor.apps.production.db.ProdProcess)

Aggregations

ProdProcess (com.axelor.apps.production.db.ProdProcess)12 ProdProcessService (com.axelor.apps.production.service.ProdProcessService)3 Transactional (com.google.inject.persist.Transactional)3 BillOfMaterial (com.axelor.apps.production.db.BillOfMaterial)2 ConfiguratorProdProcess (com.axelor.apps.production.db.ConfiguratorProdProcess)2 ProdProcessLine (com.axelor.apps.production.db.ProdProcessLine)2 ProdProcessRepository (com.axelor.apps.production.db.repo.ProdProcessRepository)2 AxelorException (com.axelor.exception.AxelorException)2 Product (com.axelor.apps.base.db.Product)1 Unit (com.axelor.apps.base.db.Unit)1 ProductRepository (com.axelor.apps.base.db.repo.ProductRepository)1 ConfiguratorBOM (com.axelor.apps.production.db.ConfiguratorBOM)1 ConfiguratorProdProcessLine (com.axelor.apps.production.db.ConfiguratorProdProcessLine)1 ManufOrder (com.axelor.apps.production.db.ManufOrder)1 StockLocation (com.axelor.apps.stock.db.StockLocation)1 BigDecimal (java.math.BigDecimal)1