Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OBPIH-5838 Option to disable approval notifications #4324

Merged
merged 5 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Improvements after review
  • Loading branch information
awalkowiak committed Oct 23, 2023
commit d38347e3a5a19ef5a8b6afa9eb49de71130c2c41
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ class Requisition implements Comparable<Requisition>, Serializable {
return destination.supports(ActivityCode.ENABLE_REQUESTOR_APPROVAL_NOTIFICATIONS)
}

// by default always send approval workflow notifications (if not handled above)
return true
// If status is not handled above assume it is wrongly triggered and don't send notification
return false
}

Map toJson() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class RequisitionStatusTransitionEventService implements ApplicationListener<Req
NotificationService notificationService

void onApplicationEvent(RequisitionStatusTransitionEvent event) {
notificationService.publishRequisitionStatusTransitionNotifications(event.requisition)
if (event.requisition.shouldSendApprovalNotification()) {
notificationService.publishRequisitionStatusTransitionNotifications(event.requisition)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,7 @@ class StockMovementService {
log.warn("Transition from ${requisition.status.name()} to ${status.name()} is not allowed - use rollback instead")
} else {
requisitionService.triggerRequisitionStatusTransition(requisition, AuthService.currentUser.get(), status, comment)
if (requisition.shouldSendApprovalNotification()) {
publishEvent(new RequisitionStatusTransitionEvent(requisition))
}
publishEvent(new RequisitionStatusTransitionEvent(requisition))
}
}

Expand Down
Loading