Skip to content

[18.0][FIX] base_tier_validation: subscribe with subtype_ids in _notify_review_available - #1329

Open
astirpe wants to merge 2 commits into
OCA:18.0from
astirpe:18_fix_base_tier_validation
Open

astirpe wants to merge 2 commits into
OCA:18.0from
astirpe:18_fix_base_tier_validation

Conversation

@astirpe

@astirpe astirpe commented Aug 26, 2026

Copy link
Copy Markdown
Member

Backport of OCA/tier-validation#21 (partial) to 18.0:

Problem

When a tier definition has Notify Reviewers on reaching Pending (notify_on_pending) enabled, the reviewer never receives anything.

The chatter shows the "A review has been requested by ..." entry, so the notification looks like it fired — but no mail.mail record is created at all, not even a queued or failed one, and message.notified_partner_ids on the posted message is empty.

notify_on_create on the same definition works correctly, which makes the failure easy to miss: the first tier is notified, later tiers silently are not.

Reproduce

  1. Create a tier definition with notify_on_pending=True (and notify_on_create=False) with a reviewer who is not the requesting user.
  2. Request validation on a matching record.
  3. The review reaches pending and the chatter entry appears.
  4. Settings ‣ Technical ‣ Email ‣ Emails — nothing for that record.

bosd added 2 commits August 26, 2026 19:31
…iew_available

The tier-validation subtypes are marked default=False in
mail_data.xml, so a plain message_subscribe(partner_ids=...) leaves
the partner subscribed only to default subtypes. The subsequent
message_post(subtype_xmlid='mt_tier_validation_requested', ...)
then routes to nobody -- notified_partner_ids ends up empty even
though the reviewer's definition has notify_on_pending=True.

Mirror what _notify_review_requested already does: pass
subtype_ids to message_subscribe and short-circuit when there
is no reviewer to notify (avoid posting a stray subtype message that
nobody is subscribed to).

(cherry picked from commit 6c64fd3eab4240ee34163b979cf3fa5c6a4c7e12)
Adds test_19b_notify_review_available_no_op_when_no_users which
calls _notify_review_available directly with a review whose
definition has notify_on_pending=False. Asserts no follower is
added and no chatter message is posted -- covering the
if not users_to_notify: continue guard that codecov flagged.

(cherry picked from commit 60d08727d15a0caa5dc7835fded3c1aea949dfe7)
@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 series:18.0 mod:base_tier_validation Module base_tier_validation labels Aug 26, 2026
@astirpe
astirpe marked this pull request as ready for review August 26, 2026 17:52
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:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants