Skip to content

[ADD] base_tier_validation: allow_bulk_approve on tier.definition#46

Open
bosd wants to merge 1 commit into
OCA:19.0from
bosd:19.0-add-base_tier_validation-allow_bulk_approve
Open

[ADD] base_tier_validation: allow_bulk_approve on tier.definition#46
bosd wants to merge 1 commit into
OCA:19.0from
bosd:19.0-add-base_tier_validation-allow_bulk_approve

Conversation

@bosd
Copy link
Copy Markdown
Contributor

@bosd bosd commented May 14, 2026

Why

Reviewers regularly need to validate many tier reviews at once — typical
month-end use cases include batch-approving expense lines, vendor bills
or other recurring documents that all follow the same simple
single-tier definition. Today they have to open each record and click
Validate individually.

What

Adds a per-definition opt-in:

  • New Boolean Allow Bulk Approve on `tier.definition` (default
    False, so existing setups behave exactly as before).
  • New related Boolean on `tier.review` so the field is reachable from
    the review list.
  • New `tier.review.action_bulk_validate()` server method, wired to a
    Validate header button on the tier review list view.

AND semantics

A review in the selection is approved only if all of the following
hold:

  • The review is pending and the current user is in its `reviewer_ids`.
  • It is the user's reviewer-of-the-moment (`can_review`).
  • Its definition has `allow_bulk_approve=True`.
  • Its definition does not require a comment (a bulk action cannot
    prompt for one).

Reviews that fail any check are skipped silently — the user just sees
which records moved.

Each underlying record's own `_validate_tier` is invoked, so the
existing notification, approve-sequence promotion and review-counter
update paths are preserved.

Tests

Four new tests in `test_tier_validation.py`:

  • approves eligible reviews across multiple records
  • skips reviews on definitions without the flag
  • skips reviews not assigned to the current user
  • skips reviews whose definition requires a comment

Out of scope (deliberately)

No bulk reject, no new `res.groups` to gate the action — both
discussed and explicitly dropped.

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @LoisRForgeFlow,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added mod:base_tier_validation Module base_tier_validation series:19.0 labels May 14, 2026
Reviewers often need to validate many reviews at once (e.g. month-end
batch approval of expense lines). Add an opt-in Boolean on
tier.definition; when set, the tier.review list view exposes a Validate
header button that approves every selected eligible review.

Eligibility (AND semantics): the review is pending and assigned to the
current user, it is the reviewer-of-the-moment (can_review), the
definition opts in via allow_bulk_approve, and the definition does not
require a comment (which cannot be collected in a bulk action). Reviews
that fail any of these are skipped silently; each underlying record's
own _validate_tier is invoked so notifications and approve-sequence
promotion keep working.
@bosd bosd force-pushed the 19.0-add-base_tier_validation-allow_bulk_approve branch from 0ca5daa to 3196429 Compare May 14, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:base_tier_validation Module base_tier_validation series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants