Skip to content

fix: Penalty Rejection reason mandatory#6203

Open
pjamsheer wants to merge 1 commit into
version-15from
fix_penalty_reject
Open

fix: Penalty Rejection reason mandatory#6203
pjamsheer wants to merge 1 commit into
version-15from
fix_penalty_reject

Conversation

@pjamsheer

Copy link
Copy Markdown
Contributor

This pull request improves the rejection workflow in the Penalty doctype by making the "Reason for Rejection" field mandatory and adding validation to ensure a reason is provided before proceeding. This helps enforce required input and prevents accidental submissions without a rejection reason.

Enhancements to rejection dialog validation:

  • Made the rejection_reason field required in the rejection dialog for penalties.
  • Added client-side validation to display a message and prevent submission if the rejection reason is empty or only whitespace.

@pjamsheer pjamsheer requested a review from Copilot June 8, 2026 17:23
@pjamsheer pjamsheer changed the title fix: Penality Rejection reason mandatory fix: Penalty Rejection reason mandatory Jun 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the client-side “Reject Penalty” workflow in Penalty to enforce that a rejection reason is provided before the rejection call is made, preventing empty/whitespace submissions.

Changes:

  • Marked the rejection reason field as required in the rejection dialog.
  • Added client-side validation to block submissions when the reason is empty/whitespace.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 79 to +83
primary_action: function(){
let {rejection_reason} = rejection_dialog.get_values();

// Validate that rejection reason is not empty
if(!rejection_reason || rejection_reason.trim() === ''){
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants