[19.0][ADD] base_tier_validation: tier.definition.allow_reject for sign-off tiers#42
Open
bosd wants to merge 1 commit into
Open
[19.0][ADD] base_tier_validation: tier.definition.allow_reject for sign-off tiers#42bosd wants to merge 1 commit into
bosd wants to merge 1 commit into
Conversation
… tiers Model some tier reviews as "informational" / "sign-off" only -- the reviewer is expected to acknowledge but cannot block the workflow with a Reject. Implemented as a per-definition Boolean so the tier author controls the policy, rather than a per-user gate. - New ``tier.definition.allow_reject`` Boolean (default ``True``, i.e. backwards compatible -- nothing changes for existing definitions). When unchecked, reviewers of that tier see Validate but no Reject on the validation banner. - New computed ``tier.validation.can_reject`` Boolean that drives the Reject button's visibility in the form template. It is True only if the user can act on the record *and* at least one of their actionable tier reviews has ``allow_reject = True``. - ``reject_tier`` now filters out reviews whose definition forbids rejection. A reviewer assigned to a mix of sign-off and regular tiers can still reject the regular ones; the sign-off ones stay pending. - ``allow_reject`` exposed on the tier definition form view under the approve-sequence block. Tests: - ``test_allow_reject_false_hides_reject_button`` -- a sign-off definition leaves ``can_review`` True but flips ``can_reject`` False, so the template hides the button. - ``test_reject_tier_skips_definitions_with_allow_reject_false`` -- the action itself only rejects the reviews whose definition allows it; sign-off reviews stay pending. Future work (deferred): an optional ``reject_user_ids`` Many2many on the definition would let a single tier be rejectable by some reviewers (e.g. seniors) but only sign-off-able by others. This PR ships the simpler per-definition gate first.
Contributor
|
Hi @LoisRForgeFlow, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a per-definition Boolean
allow_rejectso workflows can model sign-off / informational tiers where the reviewer acknowledges the document but cannot reject it.allow_reject = True(default)allow_reject = FalseRequested by a client who wanted certain tiers to act as "seen" stamps rather than veto points.
How it works
approve_sequence,approve_sequence_bypass).tier.validation.can_rejectdrives the Reject button'sinvisible="not can_reject". True iff the user can act AND at least one of their actionable reviews hasallow_reject=True.reject_tieris also filtered: a reviewer assigned to a mix of sign-off and regular tiers can still reject the regular ones; the sign-off reviews stay pending.Backwards compatibility
allow_rejectdefaults toTrue. Existing definitions and behaviour are unchanged. Opt-in.Tests
test_allow_reject_false_hides_reject_button—can_reviewstays True,can_rejectflips False.test_reject_tier_skips_definitions_with_allow_reject_false— reject_tier called on a mixed batch only rejects the rejectable tiers.Future work (deferred)
Optional
reject_user_idsMany2many on the definition would let a single tier be rejectable by some reviewers (e.g. seniors) but only sign-off-able by others. Held back until a real client asks; the per-definition gate covers the immediate ask.