diff --git a/base_tier_validation/README.rst b/base_tier_validation/README.rst index 5c97d71c7..a0a527df2 100644 --- a/base_tier_validation/README.rst +++ b/base_tier_validation/README.rst @@ -125,6 +125,23 @@ improvement will be very valuable. Changelog ========= +19.0.1.0.4 (2026-05-13) +----------------------- + +UI improvement: + +- The "needs to be validated" banner shown above tier-validated + documents now surfaces *who* is expected to act, when known. Reads + "Pending validation by John" or "Pending validation by Group + Accountants" instead of the generic "This Record needs to be + validated", with a fallback to the model-name phrasing for the + defensive edge case where no review has reached ``pending`` yet. + Reuses ``tier.review.todo_by`` so every review type (individual user, + group, ``res.users`` / ``res.groups`` field) is handled uniformly. The + banner template now reads from the long-standing + ``to_validate_message`` Html field, which was previously defined on + the model but never rendered. + 19.0.1.0.1 (2026-05-12) ----------------------- diff --git a/base_tier_validation/models/tier_validation.py b/base_tier_validation/models/tier_validation.py index 29896f80b..782cca05d 100644 --- a/base_tier_validation/models/tier_validation.py +++ b/base_tier_validation/models/tier_validation.py @@ -172,11 +172,32 @@ def _get_to_validate_message_name(self): return self._description def _get_to_validate_message(self): - return f""" { - self.env._( - "This %s needs to be validated", self._get_to_validate_message_name() + """Build the contextual "needs to be validated" banner body. + + When at least one review has reached ``pending`` and carries a + ``todo_by`` label (i.e. the assignee is known -- a user, a group + or a field-based reviewer), surface it inline so the reader can + see at a glance *who* is expected to act next, not just *that* + action is needed. + + Falls back to the model-name phrasing -- "This Sale Order needs + to be validated" -- when no pending review is available yet + (defensive: e.g. the ``waiting`` edge state, or downstream code + that calls this on a fresh record). + """ + icon = '' + pending = self.review_ids.filtered(lambda r: r.status == "pending")[:1] + if pending and pending.todo_by: + return self.env._( + "%(icon)s Pending validation by %(todo_by)s", + icon=icon, + todo_by=pending.todo_by, ) - }""" + return self.env._( + "%(icon)s This %(model_name)s needs to be validated", + icon=icon, + model_name=self._get_to_validate_message_name(), + ) def _get_validated_message(self): msg = f""" { @@ -190,7 +211,7 @@ def _get_rejected_message(self): }""" return self.validation_status == "rejected" and msg or "" - @api.depends("validation_status") + @api.depends("validation_status", "review_ids.status", "review_ids.todo_by") def _compute_to_validate_message(self): for rec in self: rec.to_validate_message = rec._get_to_validate_message() diff --git a/base_tier_validation/readme/HISTORY.md b/base_tier_validation/readme/HISTORY.md index 740cd6ca2..d0d5ab671 100644 --- a/base_tier_validation/readme/HISTORY.md +++ b/base_tier_validation/readme/HISTORY.md @@ -1,3 +1,20 @@ +## 19.0.1.0.4 (2026-05-13) + +UI improvement: + +- The "needs to be validated" banner shown above tier-validated + documents now surfaces *who* is expected to act, when known. + Reads "Pending validation by John" or "Pending validation by + Group Accountants" instead of the generic + "This Record needs to be validated", with a fallback to the + model-name phrasing for the defensive edge case where no review + has reached ``pending`` yet. Reuses ``tier.review.todo_by`` so + every review type (individual user, group, ``res.users`` / + ``res.groups`` field) is handled uniformly. The banner template + now reads from the long-standing ``to_validate_message`` Html + field, which was previously defined on the model but never + rendered. + ## 19.0.1.0.1 (2026-05-12) Fixes: diff --git a/base_tier_validation/static/description/index.html b/base_tier_validation/static/description/index.html index 8d3911153..3be2d110c 100644 --- a/base_tier_validation/static/description/index.html +++ b/base_tier_validation/static/description/index.html @@ -398,30 +398,31 @@

Base Tier Validation

  • Configuration
  • Known issues / Roadmap
  • Changelog
  • -
  • Bug Tracker
  • -
  • Credits @@ -490,7 +491,24 @@

    Known issues / Roadmap

    Changelog

    -

    19.0.1.0.1 (2026-05-12)

    +

    19.0.1.0.4 (2026-05-13)

    +

    UI improvement:

    +
      +
    • The “needs to be validated” banner shown above tier-validated +documents now surfaces who is expected to act, when known. Reads +“Pending validation by John” or “Pending validation by Group +Accountants” instead of the generic “This Record needs to be +validated”, with a fallback to the model-name phrasing for the +defensive edge case where no review has reached pending yet. +Reuses tier.review.todo_by so every review type (individual user, +group, res.users / res.groups field) is handled uniformly. The +banner template now reads from the long-standing +to_validate_message Html field, which was previously defined on +the model but never rendered.
    • +
    +
    +
    +

    19.0.1.0.1 (2026-05-12)

    Fixes:

    • Restore auto-promotion of the lowest-sequence review to pending @@ -512,18 +530,18 @@

      19.0.1.0.1 (2026-05-12)

      subtype_ids explicitly (mirroring _notify_review_requested).
    -
    -

    17.0.1.0.0 (2024-01-10)

    +
    +

    17.0.1.0.0 (2024-01-10)

    Migrated to Odoo 17. Merged module with tier_validation_waiting. To support sending messages in a validation sequence when it is their turn to validate.

    -
    -

    14.0.1.0.0 (2020-11-19)

    +
    +

    14.0.1.0.0 (2020-11-19)

    Migrated to Odoo 14.

    -
    -

    13.0.1.2.2 (2020-08-30)

    +
    +

    13.0.1.2.2 (2020-08-30)

    Fixes:

    • When using approve_sequence option in any tier.definition there can be @@ -532,84 +550,84 @@

      13.0.1.2.2 (2020-08-30)

      sequence, but also other sequence for the same approver
    -
    -

    12.0.3.3.1 (2019-12-02)

    +
    +

    12.0.3.3.1 (2019-12-02)

    Fixes:

    • Show comment on Reviews Table.
    • Edit notification with approve_sequence.
    -
    -

    12.0.3.3.0 (2019-11-27)

    +
    +

    12.0.3.3.0 (2019-11-27)

    New features:

    • Add comment on Reviews Table.
    • Approve by sequence.
    -
    -

    12.0.3.2.1 (2019-11-26)

    +
    +

    12.0.3.2.1 (2019-11-26)

    Fixes:

    • Remove message_subscribe_users
    -
    -

    12.0.3.2.0 (2019-11-25)

    +
    +

    12.0.3.2.0 (2019-11-25)

    New features:

    • Notify reviewers
    -
    -

    12.0.3.1.0 (2019-07-08)

    +
    +

    12.0.3.1.0 (2019-07-08)

    Fixes:

    • Singleton error
    -
    -

    12.0.3.0.0 (2019-12-02)

    +
    +

    12.0.3.0.0 (2019-12-02)

    Fixes:

    • Edit Reviews Table
    -
    -

    12.0.2.1.0 (2019-05-29)

    +
    +

    12.0.2.1.0 (2019-05-29)

    Fixes:

    • Edit drop-down style width and position
    -
    -

    12.0.2.0.0 (2019-05-28)

    +
    +

    12.0.2.0.0 (2019-05-28)

    New features:

    • Pass parameters as functions.
    • Add Systray.
    -