Skip to content

[19.0][IMP] base_tier_validation: name the assignee in the "to validate" banner#24

Open
bosd wants to merge 1 commit into
OCA:19.0from
bosd:19.0-imp-tier-pending-banner
Open

[19.0][IMP] base_tier_validation: name the assignee in the "to validate" banner#24
bosd wants to merge 1 commit into
OCA:19.0from
bosd:19.0-imp-tier-pending-banner

Conversation

@bosd
Copy link
Copy Markdown
Contributor

@bosd bosd commented May 12, 2026

What

The yellow banner shown above a tier-validated document currently reads

This Record needs to be validated.

…which is generic in two ways: it does not say which model the record belongs to, and -- more importantly -- it does not say who is expected to act. Users in our rollout consistently asked "who's holding this up?" even though that information already exists on tier.review.todo_by.

This PR makes the banner read, for example:

Pending validation by John
Pending validation by Group Accountants
Pending validation by Mike, Jane (and 2 more)

…sourced from the same todo_by the Reviews table already uses, so individual users, groups, res.users / res.groups field reviewers and Python-expression reviewers all render uniformly.

When no review has yet reached pending (defensive edge case -- e.g. waiting state, or downstream code that calls the method on a fresh record), the banner falls back to the existing model-name phrasing:

This Sale Order needs to be validated.

Plumbing

  • _get_to_validate_message now picks the lowest-sequence pending review and embeds its todo_by into the body.
  • _compute_to_validate_message now depends on review_ids.status and review_ids.todo_by in addition to validation_status, so the banner refreshes when a tier is promoted or when the assignee changes.
  • The tier_validation_label template now actually renders the to_validate_message Html field (which has existed on the abstract model since v14 but was never wired into the template; the template carried its own hardcoded text).

Tests

  • test_19c_to_validate_message_names_assignee -- after a tier reaches pending, the banner contains the assignee and does not contain the generic phrasing.
  • test_19d_to_validate_message_falls_back_when_no_pending -- with no pending review on the record, the banner falls back to the model-name phrasing.

Notes

CC @LoisRForgeFlow

@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 12, 2026
@bosd bosd changed the title [IMP] base_tier_validation: name the assignee in the "to validate" banner [19.0][IMP] base_tier_validation: name the assignee in the "to validate" banner May 12, 2026
…nner

The yellow banner shown above a tier-validated document used to read

    This Record needs to be validated.

which is generic in two ways: it does not say which model the
record belongs to, and -- more importantly -- it does not say *who*
is expected to act. Users in our rollout consistently asked
"who's holding this up?" even though that information already
exists on the underlying ``tier.review.todo_by``.

Rework ``_get_to_validate_message`` to surface the pending tier's
``todo_by`` inline so the banner reads, for example:

    Pending validation by John
    Pending validation by Group Accountants
    Pending validation by Mike, Jane (and 2 more)

When no review has reached ``pending`` yet (e.g. the defensive
``waiting`` edge case, or downstream code calling the method on a
fresh record), fall back to the existing model-name phrasing:

    This Sale Order needs to be validated.

Plumbing:

- ``_compute_to_validate_message`` now depends on
  ``review_ids.status`` and ``review_ids.todo_by`` in addition to
  ``validation_status``, so the banner refreshes when a tier reaches
  pending or when the assignee changes.
- The ``tier_validation_label`` template now actually renders the
  ``to_validate_message`` field (long-defined on the abstract model
  but never previously wired into the template, which carried its
  own hardcoded text).
- ``todo_by`` is reused so every review type -- individual user,
  group, ``res.users`` / ``res.groups`` field, Python expression --
  is handled by one path and stays consistent with the Reviews
  table below.

Tests:

- ``test_19c_to_validate_message_names_assignee`` -- after a tier
  reaches ``pending``, the banner contains the assignee and not the
  generic phrasing.
- ``test_19d_to_validate_message_falls_back_when_no_pending`` --
  with no pending review, the banner falls back to the model-name
  phrasing.
@bosd bosd force-pushed the 19.0-imp-tier-pending-banner branch from 0f7c115 to 086ed4d Compare May 13, 2026 15:57
@bosd
Copy link
Copy Markdown
Contributor Author

bosd commented May 14, 2026

Now one can see exactly who it is waitiing on, when doing a sequenced validation:

Before:
image

After:
image

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