use of com.axelor.apps.sale.service.configurator.ConfiguratorCreatorService in project axelor-open-suite by axelor.
the class ConfiguratorCreatorController method updateAndActivate.
/**
* Called from the configurator creator form on formula changes
*
* @param request
* @param response
*/
public void updateAndActivate(ActionRequest request, ActionResponse response) {
try {
ConfiguratorCreator creator = request.getContext().asType(ConfiguratorCreator.class);
ConfiguratorCreatorService configuratorCreatorService = Beans.get(ConfiguratorCreatorService.class);
creator = Beans.get(ConfiguratorCreatorRepository.class).find(creator.getId());
configuratorCreatorService.updateIndicators(creator);
configuratorCreatorService.activate(creator);
response.setSignal("refresh-app", true);
} catch (Exception e) {
TraceBackService.trace(e);
}
}
use of com.axelor.apps.sale.service.configurator.ConfiguratorCreatorService in project axelor-open-suite by axelor.
the class ConfiguratorCreatorSaleRepository method save.
@Override
public ConfiguratorCreator save(ConfiguratorCreator entity) {
try {
if (entity.getCopyNeedingUpdate()) {
entity = super.save(entity);
entity.setCopyNeedingUpdate(false);
Beans.get(ConfiguratorCreatorImportService.class).fixAttributesName(entity);
ConfiguratorCreatorService configuratorCreatorService = Beans.get(ConfiguratorCreatorService.class);
configuratorCreatorService.updateAttributes(entity);
configuratorCreatorService.updateIndicators(entity);
return entity;
} else {
return super.save(entity);
}
} catch (Exception e) {
TraceBackService.traceExceptionFromSaveMethod(e);
throw new PersistenceException(e.getMessage(), e);
}
}
Aggregations