Search in sources :

Example 6 with Mrp

use of com.axelor.apps.supplychain.db.Mrp 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);
    }
}
Also used : Mrp(com.axelor.apps.supplychain.db.Mrp) MrpService(com.axelor.apps.supplychain.service.MrpService) MrpRepository(com.axelor.apps.supplychain.db.repo.MrpRepository) AxelorException(com.axelor.exception.AxelorException)

Example 7 with Mrp

use of com.axelor.apps.supplychain.db.Mrp in project axelor-open-suite by axelor.

the class MrpLineController method selectAll.

@Transactional(rollbackOn = { Exception.class })
public void selectAll(ActionRequest request, ActionResponse response) {
    try {
        Mrp mrp = request.getContext().getParent().asType(Mrp.class);
        mrp = Beans.get(MrpRepository.class).find(mrp.getId());
        Beans.get(MrpService.class).massUpdateProposalToProcess(mrp, true);
        response.setAttr("mrpLinePanel", "refresh", true);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : Mrp(com.axelor.apps.supplychain.db.Mrp) MrpService(com.axelor.apps.supplychain.service.MrpService) AxelorException(com.axelor.exception.AxelorException) Transactional(com.google.inject.persist.Transactional)

Example 8 with Mrp

use of com.axelor.apps.supplychain.db.Mrp in project axelor-open-suite by axelor.

the class MrpManagementRepository method copy.

@Override
public Mrp copy(Mrp entity, boolean deep) {
    Mrp copy = super.copy(entity, deep);
    copy.setMrpSeq(null);
    return copy;
}
Also used : Mrp(com.axelor.apps.supplychain.db.Mrp)

Aggregations

Mrp (com.axelor.apps.supplychain.db.Mrp)8 AxelorException (com.axelor.exception.AxelorException)6 MrpService (com.axelor.apps.supplychain.service.MrpService)5 MrpRepository (com.axelor.apps.supplychain.db.repo.MrpRepository)2 Transactional (com.google.inject.persist.Transactional)2 Company (com.axelor.apps.base.db.Company)1 Product (com.axelor.apps.base.db.Product)1 CompanyRepository (com.axelor.apps.base.db.repo.CompanyRepository)1 ProductRepository (com.axelor.apps.base.db.repo.ProductRepository)1 StockLocation (com.axelor.apps.stock.db.StockLocation)1 MrpLine (com.axelor.apps.supplychain.db.MrpLine)1 MrpLineRepository (com.axelor.apps.supplychain.db.repo.MrpLineRepository)1