Skip to content

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

Merged
OCA-git-bot merged 1 commit into
OCA:19.0from
bosd:19.0-imp-tier-pending-banner
Jul 22, 2026
Merged

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

Conversation

@bosd

@bosd bosd commented May 12, 2026

Copy link
Copy Markdown
Contributor

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
@bosd
bosd force-pushed the 19.0-imp-tier-pending-banner branch from 0f7c115 to 086ed4d Compare May 13, 2026 15:57
@bosd

bosd commented May 14, 2026

Copy link
Copy Markdown
Contributor Author

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

Before:
image

After:
image

Comment thread base_tier_validation/__manifest__.py Outdated
…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 086ed4d to 6c8ea00 Compare June 5, 2026 20:36

@Dranyel-Bosd Dranyel-Bosd left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM 💯

@LoisRForgeFlow LoisRForgeFlow 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.

LGTM 👍

@LoisRForgeFlow

Copy link
Copy Markdown
Contributor

/ocabot merge minor

@OCA-git-bot

Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 19.0-ocabot-merge-pr-24-by-LoisRForgeFlow-bump-minor, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit b46bcfe into OCA:19.0 Jul 22, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 732e49c. Thanks a lot for contributing to OCA. ❤️

@bosd
bosd deleted the 19.0-imp-tier-pending-banner branch July 23, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants