diff --git a/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java b/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java index b3adda62..82881c0f 100644 --- a/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java @@ -68,7 +68,11 @@ public abstract class RequirementBaseServiceImpl exte super.add(entity); - this.sendToApprovers(entity); + if (canApprove(entity)) { + approve(entity); + } else { + this.sendToApprovers(entity); + } } private void checkEnable() { @@ -220,12 +224,10 @@ public abstract class RequirementBaseServiceImpl exte } else { e.setState(RequirementState.PARTIALLY); } - entity.setState(e.getState()); - entity.getAuthorization().add(auth); super.update(e); - if (!autoApprove(entity)) { + if (!autoApprove(e)) { this.sendToApprovers(e); SettingsData settings = settingsService.getSettings();