Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions base_tier_validation/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,29 @@ improvement will be very valuable.
Changelog
=========

19.0.1.0.1 (2026-05-12)
-----------------------

Fixes:

- Restore auto-promotion of the lowest-sequence review to ``pending``
immediately after ``request_validation`` so the workflow can move
forward without an external trigger. The 19.0 migration had moved this
side-effect out of ``_compute_can_review`` into a separate
``_update_review_status`` that was only invoked when the requester was
themself the first reviewer or when ``notify_on_create`` was set,
leaving reviews stuck in ``waiting`` in every other case.
- Coerce ``next_review`` to ``False`` when no review is pending, so the
"needs to be validated" banner no longer leaks the empty
``tier.review()`` recordset repr into its ``Char`` field.
- Fix ``_notify_review_available`` so the reviewer reached by
``notify_on_pending`` is actually delivered the message. The
tier-validation subtypes have ``default=False`` so a plain
``message_subscribe(partner_ids=...)`` left the reviewer subscribed
only to default subtypes; ``message_post`` with the
``mt_tier_validation_requested`` subtype then routed to nobody. Pass
``subtype_ids`` explicitly (mirroring ``_notify_review_requested``).

17.0.1.0.0 (2024-01-10)
-----------------------

Expand Down
2 changes: 1 addition & 1 deletion base_tier_validation/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Base Tier Validation",
"summary": "Implement a validation process based on tiers.",
"version": "19.0.1.0.0",
"version": "19.0.1.0.1",
"development_status": "Mature",
"maintainers": ["LoisRForgeFlow"],
"category": "Tools",
Expand Down
32 changes: 20 additions & 12 deletions base_tier_validation/models/tier_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def _compute_next_review(self):
review = rec.review_ids.sorted("sequence").filtered(
lambda x: x.status == "pending"
)[:1]
rec.next_review = review and self.env._("Next: %s", review.name or "")
rec.next_review = self.env._("Next: %s", review.name) if review else False

def _compute_hide_reviews(self):
for rec in self:
Expand Down Expand Up @@ -788,16 +788,15 @@ def request_validation(self):
sequence += 1
vals_list.append(rec._prepare_tier_review_vals(td, sequence))
created_trs = tr_obj.create(vals_list)
review_counter = any(self.mapped("can_review"))
if review_counter:
# ``request_validation`` creates all reviews as ``waiting``. Promote the
# available one(s) to ``pending`` immediately so the workflow can move
# forward without an external trigger. Without this, when the user
# asking for validation is not themself the first reviewer (and no
# ``notify_on_create`` definition is present), reviews would stay in
# ``waiting`` indefinitely and no reviewer would be notified.
created_trs._update_review_status()
if any(self.mapped("can_review")):
self._update_counter({"review_created": True})
# ``request_validation`` creates all reviews as ``waiting``.
# If the counter update have not already updated the actionable review status,
# do it before notifying reviewers about creation.
if not review_counter and created_trs.filtered(
"definition_id.notify_on_create"
):
created_trs._update_review_status()
self._notify_review_requested(created_trs)
return created_trs

Expand Down Expand Up @@ -945,9 +944,18 @@ def _notify_review_available(self, tier_reviews):
lambda r, x=rec: r.definition_id.notify_on_pending
and r.res_id == x.id
).mapped("reviewer_ids")
# Subscribe reviewers and notify
# Subscribe reviewers to the tier-validation-requested
# subtype explicitly, otherwise ``message_post`` below would
# route to no one (the subtype is ``default=False``). Only
# post the message when at least one reviewer wants to be
# notified -- mirroring ``_notify_review_requested``.
if not users_to_notify:
continue
rec.message_subscribe(
partner_ids=users_to_notify.mapped("partner_id").ids
partner_ids=users_to_notify.mapped("partner_id").ids,
subtype_ids=self.env.ref(
self._get_requested_notification_subtype()
).ids,
)
rec.message_post(
subtype_xmlid=self._get_requested_notification_subtype(),
Expand Down
22 changes: 22 additions & 0 deletions base_tier_validation/readme/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## 19.0.1.0.1 (2026-05-12)

Fixes:

- Restore auto-promotion of the lowest-sequence review to ``pending``
immediately after ``request_validation`` so the workflow can move
forward without an external trigger. The 19.0 migration had moved
this side-effect out of ``_compute_can_review`` into a separate
``_update_review_status`` that was only invoked when the requester
was themself the first reviewer or when ``notify_on_create`` was
set, leaving reviews stuck in ``waiting`` in every other case.
- Coerce ``next_review`` to ``False`` when no review is pending, so
the "needs to be validated" banner no longer leaks the empty
``tier.review()`` recordset repr into its ``Char`` field.
- Fix ``_notify_review_available`` so the reviewer reached by
``notify_on_pending`` is actually delivered the message. The
tier-validation subtypes have ``default=False`` so a plain
``message_subscribe(partner_ids=...)`` left the reviewer subscribed
only to default subtypes; ``message_post`` with the
``mt_tier_validation_requested`` subtype then routed to nobody. Pass
``subtype_ids`` explicitly (mirroring ``_notify_review_requested``).

## 17.0.1.0.0 (2024-01-10)

Migrated to Odoo 17.
Expand Down
136 changes: 80 additions & 56 deletions base_tier_validation/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -398,29 +398,30 @@ <h1>Base Tier Validation</h1>
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-2">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#changelog" id="toc-entry-3">Changelog</a><ul>
<li><a class="reference internal" href="#section-1" id="toc-entry-4">17.0.1.0.0 (2024-01-10)</a></li>
<li><a class="reference internal" href="#section-2" id="toc-entry-5">14.0.1.0.0 (2020-11-19)</a></li>
<li><a class="reference internal" href="#section-3" id="toc-entry-6">13.0.1.2.2 (2020-08-30)</a></li>
<li><a class="reference internal" href="#section-4" id="toc-entry-7">12.0.3.3.1 (2019-12-02)</a></li>
<li><a class="reference internal" href="#section-5" id="toc-entry-8">12.0.3.3.0 (2019-11-27)</a></li>
<li><a class="reference internal" href="#section-6" id="toc-entry-9">12.0.3.2.1 (2019-11-26)</a></li>
<li><a class="reference internal" href="#section-7" id="toc-entry-10">12.0.3.2.0 (2019-11-25)</a></li>
<li><a class="reference internal" href="#section-8" id="toc-entry-11">12.0.3.1.0 (2019-07-08)</a></li>
<li><a class="reference internal" href="#section-9" id="toc-entry-12">12.0.3.0.0 (2019-12-02)</a></li>
<li><a class="reference internal" href="#section-10" id="toc-entry-13">12.0.2.1.0 (2019-05-29)</a></li>
<li><a class="reference internal" href="#section-11" id="toc-entry-14">12.0.2.0.0 (2019-05-28)</a></li>
<li><a class="reference internal" href="#section-12" id="toc-entry-15">12.0.1.0.0 (2019-02-18)</a></li>
<li><a class="reference internal" href="#section-13" id="toc-entry-16">11.0.1.0.0 (2018-05-09)</a></li>
<li><a class="reference internal" href="#section-14" id="toc-entry-17">10.0.1.0.0 (2018-03-26)</a></li>
<li><a class="reference internal" href="#section-15" id="toc-entry-18">9.0.1.0.0 (2017-12-02)</a></li>
<li><a class="reference internal" href="#section-1" id="toc-entry-4">19.0.1.0.1 (2026-05-12)</a></li>
<li><a class="reference internal" href="#section-2" id="toc-entry-5">17.0.1.0.0 (2024-01-10)</a></li>
<li><a class="reference internal" href="#section-3" id="toc-entry-6">14.0.1.0.0 (2020-11-19)</a></li>
<li><a class="reference internal" href="#section-4" id="toc-entry-7">13.0.1.2.2 (2020-08-30)</a></li>
<li><a class="reference internal" href="#section-5" id="toc-entry-8">12.0.3.3.1 (2019-12-02)</a></li>
<li><a class="reference internal" href="#section-6" id="toc-entry-9">12.0.3.3.0 (2019-11-27)</a></li>
<li><a class="reference internal" href="#section-7" id="toc-entry-10">12.0.3.2.1 (2019-11-26)</a></li>
<li><a class="reference internal" href="#section-8" id="toc-entry-11">12.0.3.2.0 (2019-11-25)</a></li>
<li><a class="reference internal" href="#section-9" id="toc-entry-12">12.0.3.1.0 (2019-07-08)</a></li>
<li><a class="reference internal" href="#section-10" id="toc-entry-13">12.0.3.0.0 (2019-12-02)</a></li>
<li><a class="reference internal" href="#section-11" id="toc-entry-14">12.0.2.1.0 (2019-05-29)</a></li>
<li><a class="reference internal" href="#section-12" id="toc-entry-15">12.0.2.0.0 (2019-05-28)</a></li>
<li><a class="reference internal" href="#section-13" id="toc-entry-16">12.0.1.0.0 (2019-02-18)</a></li>
<li><a class="reference internal" href="#section-14" id="toc-entry-17">11.0.1.0.0 (2018-05-09)</a></li>
<li><a class="reference internal" href="#section-15" id="toc-entry-18">10.0.1.0.0 (2018-03-26)</a></li>
<li><a class="reference internal" href="#section-16" id="toc-entry-19">9.0.1.0.0 (2017-12-02)</a></li>
</ul>
</li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-19">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-20">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-21">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-22">Contributors</a></li>
<li><a class="reference internal" href="#other-credits" id="toc-entry-23">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-24">Maintainers</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-20">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-21">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-22">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-23">Contributors</a></li>
<li><a class="reference internal" href="#other-credits" id="toc-entry-24">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-25">Maintainers</a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -489,17 +490,40 @@ <h2><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h2>
<div class="section" id="changelog">
<h2><a class="toc-backref" href="#toc-entry-3">Changelog</a></h2>
<div class="section" id="section-1">
<h3><a class="toc-backref" href="#toc-entry-4">17.0.1.0.0 (2024-01-10)</a></h3>
<h3><a class="toc-backref" href="#toc-entry-4">19.0.1.0.1 (2026-05-12)</a></h3>
<p>Fixes:</p>
<ul class="simple">
<li>Restore auto-promotion of the lowest-sequence review to <tt class="docutils literal">pending</tt>
immediately after <tt class="docutils literal">request_validation</tt> so the workflow can move
forward without an external trigger. The 19.0 migration had moved this
side-effect out of <tt class="docutils literal">_compute_can_review</tt> into a separate
<tt class="docutils literal">_update_review_status</tt> that was only invoked when the requester was
themself the first reviewer or when <tt class="docutils literal">notify_on_create</tt> was set,
leaving reviews stuck in <tt class="docutils literal">waiting</tt> in every other case.</li>
<li>Coerce <tt class="docutils literal">next_review</tt> to <tt class="docutils literal">False</tt> when no review is pending, so the
“needs to be validated” banner no longer leaks the empty
<tt class="docutils literal">tier.review()</tt> recordset repr into its <tt class="docutils literal">Char</tt> field.</li>
<li>Fix <tt class="docutils literal">_notify_review_available</tt> so the reviewer reached by
<tt class="docutils literal">notify_on_pending</tt> is actually delivered the message. The
tier-validation subtypes have <tt class="docutils literal">default=False</tt> so a plain
<tt class="docutils literal"><span class="pre">message_subscribe(partner_ids=...)</span></tt> left the reviewer subscribed
only to default subtypes; <tt class="docutils literal">message_post</tt> with the
<tt class="docutils literal">mt_tier_validation_requested</tt> subtype then routed to nobody. Pass
<tt class="docutils literal">subtype_ids</tt> explicitly (mirroring <tt class="docutils literal">_notify_review_requested</tt>).</li>
</ul>
</div>
<div class="section" id="section-2">
<h3><a class="toc-backref" href="#toc-entry-5">17.0.1.0.0 (2024-01-10)</a></h3>
<p>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.</p>
</div>
<div class="section" id="section-2">
<h3><a class="toc-backref" href="#toc-entry-5">14.0.1.0.0 (2020-11-19)</a></h3>
<div class="section" id="section-3">
<h3><a class="toc-backref" href="#toc-entry-6">14.0.1.0.0 (2020-11-19)</a></h3>
<p>Migrated to Odoo 14.</p>
</div>
<div class="section" id="section-3">
<h3><a class="toc-backref" href="#toc-entry-6">13.0.1.2.2 (2020-08-30)</a></h3>
<div class="section" id="section-4">
<h3><a class="toc-backref" href="#toc-entry-7">13.0.1.2.2 (2020-08-30)</a></h3>
<p>Fixes:</p>
<ul class="simple">
<li>When using approve_sequence option in any tier.definition there can be
Expand All @@ -508,100 +532,100 @@ <h3><a class="toc-backref" href="#toc-entry-6">13.0.1.2.2 (2020-08-30)</a></h3>
sequence, but also other sequence for the same approver</li>
</ul>
</div>
<div class="section" id="section-4">
<h3><a class="toc-backref" href="#toc-entry-7">12.0.3.3.1 (2019-12-02)</a></h3>
<div class="section" id="section-5">
<h3><a class="toc-backref" href="#toc-entry-8">12.0.3.3.1 (2019-12-02)</a></h3>
<p>Fixes:</p>
<ul class="simple">
<li>Show comment on Reviews Table.</li>
<li>Edit notification with approve_sequence.</li>
</ul>
</div>
<div class="section" id="section-5">
<h3><a class="toc-backref" href="#toc-entry-8">12.0.3.3.0 (2019-11-27)</a></h3>
<div class="section" id="section-6">
<h3><a class="toc-backref" href="#toc-entry-9">12.0.3.3.0 (2019-11-27)</a></h3>
<p>New features:</p>
<ul class="simple">
<li>Add comment on Reviews Table.</li>
<li>Approve by sequence.</li>
</ul>
</div>
<div class="section" id="section-6">
<h3><a class="toc-backref" href="#toc-entry-9">12.0.3.2.1 (2019-11-26)</a></h3>
<div class="section" id="section-7">
<h3><a class="toc-backref" href="#toc-entry-10">12.0.3.2.1 (2019-11-26)</a></h3>
<p>Fixes:</p>
<ul class="simple">
<li>Remove message_subscribe_users</li>
</ul>
</div>
<div class="section" id="section-7">
<h3><a class="toc-backref" href="#toc-entry-10">12.0.3.2.0 (2019-11-25)</a></h3>
<div class="section" id="section-8">
<h3><a class="toc-backref" href="#toc-entry-11">12.0.3.2.0 (2019-11-25)</a></h3>
<p>New features:</p>
<ul class="simple">
<li>Notify reviewers</li>
</ul>
</div>
<div class="section" id="section-8">
<h3><a class="toc-backref" href="#toc-entry-11">12.0.3.1.0 (2019-07-08)</a></h3>
<div class="section" id="section-9">
<h3><a class="toc-backref" href="#toc-entry-12">12.0.3.1.0 (2019-07-08)</a></h3>
<p>Fixes:</p>
<ul class="simple">
<li>Singleton error</li>
</ul>
</div>
<div class="section" id="section-9">
<h3><a class="toc-backref" href="#toc-entry-12">12.0.3.0.0 (2019-12-02)</a></h3>
<div class="section" id="section-10">
<h3><a class="toc-backref" href="#toc-entry-13">12.0.3.0.0 (2019-12-02)</a></h3>
<p>Fixes:</p>
<ul class="simple">
<li>Edit Reviews Table</li>
</ul>
</div>
<div class="section" id="section-10">
<h3><a class="toc-backref" href="#toc-entry-13">12.0.2.1.0 (2019-05-29)</a></h3>
<div class="section" id="section-11">
<h3><a class="toc-backref" href="#toc-entry-14">12.0.2.1.0 (2019-05-29)</a></h3>
<p>Fixes:</p>
<ul class="simple">
<li>Edit drop-down style width and position</li>
</ul>
</div>
<div class="section" id="section-11">
<h3><a class="toc-backref" href="#toc-entry-14">12.0.2.0.0 (2019-05-28)</a></h3>
<div class="section" id="section-12">
<h3><a class="toc-backref" href="#toc-entry-15">12.0.2.0.0 (2019-05-28)</a></h3>
<p>New features:</p>
<ul class="simple">
<li>Pass parameters as functions.</li>
<li>Add Systray.</li>
</ul>
</div>
<div class="section" id="section-12">
<h3><a class="toc-backref" href="#toc-entry-15">12.0.1.0.0 (2019-02-18)</a></h3>
<div class="section" id="section-13">
<h3><a class="toc-backref" href="#toc-entry-16">12.0.1.0.0 (2019-02-18)</a></h3>
<p>Migrated to Odoo 12.</p>
</div>
<div class="section" id="section-13">
<h3><a class="toc-backref" href="#toc-entry-16">11.0.1.0.0 (2018-05-09)</a></h3>
<div class="section" id="section-14">
<h3><a class="toc-backref" href="#toc-entry-17">11.0.1.0.0 (2018-05-09)</a></h3>
<p>Migrated to Odoo 11.</p>
</div>
<div class="section" id="section-14">
<h3><a class="toc-backref" href="#toc-entry-17">10.0.1.0.0 (2018-03-26)</a></h3>
<div class="section" id="section-15">
<h3><a class="toc-backref" href="#toc-entry-18">10.0.1.0.0 (2018-03-26)</a></h3>
<p>Migrated to Odoo 10.</p>
</div>
<div class="section" id="section-15">
<h3><a class="toc-backref" href="#toc-entry-18">9.0.1.0.0 (2017-12-02)</a></h3>
<div class="section" id="section-16">
<h3><a class="toc-backref" href="#toc-entry-19">9.0.1.0.0 (2017-12-02)</a></h3>
<p>First version.</p>
</div>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-19">Bug Tracker</a></h2>
<h2><a class="toc-backref" href="#toc-entry-20">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/tier-validation/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/tier-validation/issues/new?body=module:%20base_tier_validation%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#toc-entry-20">Credits</a></h2>
<h2><a class="toc-backref" href="#toc-entry-21">Credits</a></h2>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-21">Authors</a></h3>
<h3><a class="toc-backref" href="#toc-entry-22">Authors</a></h3>
<ul class="simple">
<li>ForgeFlow</li>
</ul>
</div>
<div class="section" id="contributors">
<h3><a class="toc-backref" href="#toc-entry-22">Contributors</a></h3>
<h3><a class="toc-backref" href="#toc-entry-23">Contributors</a></h3>
<ul class="simple">
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;forgeflow.com">lois.rilo&#64;forgeflow.com</a>&gt;</li>
<li>Naglis Jonaitis &lt;<a class="reference external" href="mailto:naglis&#64;versada.eu">naglis&#64;versada.eu</a>&gt;</li>
Expand All @@ -626,10 +650,10 @@ <h3><a class="toc-backref" href="#toc-entry-22">Contributors</a></h3>
</ul>
</div>
<div class="section" id="other-credits">
<h3><a class="toc-backref" href="#toc-entry-23">Other credits</a></h3>
<h3><a class="toc-backref" href="#toc-entry-24">Other credits</a></h3>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-24">Maintainers</a></h3>
<h3><a class="toc-backref" href="#toc-entry-25">Maintainers</a></h3>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand Down
Loading
Loading