Search in sources :

Example 16 with StockConfig

use of com.axelor.apps.stock.db.StockConfig in project axelor-open-suite by axelor.

the class AppStockServiceImpl method generateStockConfigurations.

@Override
@Transactional
public void generateStockConfigurations() {
    List<Company> companies = companyRepo.all().filter("self.stockConfig is null").fetch();
    for (Company company : companies) {
        StockConfig stockConfig = new StockConfig();
        stockConfig.setCompany(company);
        stockConfigRepo.save(stockConfig);
    }
}
Also used : Company(com.axelor.apps.base.db.Company) StockConfig(com.axelor.apps.stock.db.StockConfig) Transactional(com.google.inject.persist.Transactional)

Aggregations

StockConfig (com.axelor.apps.stock.db.StockConfig)16 StockLocation (com.axelor.apps.stock.db.StockLocation)8 Company (com.axelor.apps.base.db.Company)7 StockConfigProductionService (com.axelor.apps.production.service.config.StockConfigProductionService)7 AxelorException (com.axelor.exception.AxelorException)7 StockMove (com.axelor.apps.stock.db.StockMove)6 StockConfigService (com.axelor.apps.stock.service.config.StockConfigService)6 Transactional (com.google.inject.persist.Transactional)5 StockMoveLine (com.axelor.apps.stock.db.StockMoveLine)3 BigDecimal (java.math.BigDecimal)3 ArrayList (java.util.ArrayList)3 Product (com.axelor.apps.base.db.Product)2 ProdProcessLine (com.axelor.apps.production.db.ProdProcessLine)2 ProdProduct (com.axelor.apps.production.db.ProdProduct)2 StockMoveRepository (com.axelor.apps.stock.db.repo.StockMoveRepository)2 StockMoveLineService (com.axelor.apps.stock.service.StockMoveLineService)2 StockMoveService (com.axelor.apps.stock.service.StockMoveService)2 Beans (com.axelor.inject.Beans)2 Inject (com.google.inject.Inject)2 List (java.util.List)2