Skip to content

[18.0][FIX] base_tier_validation_forward: fix forward notification delivery#1279

Open
llabusch93 wants to merge 1 commit into
OCA:18.0from
labiso-gmbh:18.0-fix-tier-validation-forward-notification
Open

[18.0][FIX] base_tier_validation_forward: fix forward notification delivery#1279
llabusch93 wants to merge 1 commit into
OCA:18.0from
labiso-gmbh:18.0-fix-tier-validation-forward-notification

Conversation

@llabusch93

Copy link
Copy Markdown

Summary

Two bugs in base_tier_validation_forward prevent forwarded review notifications from reaching the target user:

Bug 1 — Wrong subtype_xmlid: _get_forwarded_notification_subtype() returns "base_tier_validation.mt_tier_validation_forwarded" but the mail.message.subtype record is defined in the base_tier_validation_forward module (see data/mail_data.xml). When message_post() cannot resolve the xmlid, it silently falls back to mail.mt_note — internal notes do not generate email notifications for followers.

Bug 2 — Forward target not subscribed as follower: The forward wizard add_forward() creates a tier.review for the target user but never calls message_subscribe(). Without being a follower of the record, the target user cannot receive email notifications even if the subtype were correct.

Combined effect: When a reviewer forwards their approval to another user, the target user is never notified by email. The forward "works" technically (the review record is created), but the target user has no way of knowing they need to act — unless they happen to be actively browsing the record's chatter.

Changes

  • models/tier_validation.py: Fix the module prefix in _get_forwarded_notification_subtype() from base_tier_validationbase_tier_validation_forward
  • wizard/forward_wizard.py: Call message_subscribe() in add_forward() to subscribe the forward target as a follower with the forward notification subtype
  • tests/test_tier_validation.py: Add 3 tests — subtype xmlid correctness, message subtype verification, follower subscription after forward

Two bugs prevent forwarded review notifications from reaching the
target user:

1. _get_forwarded_notification_subtype() returns the wrong xmlid
   "base_tier_validation.mt_tier_validation_forwarded" but the
   mail.message.subtype record is defined in base_tier_validation_forward.
   message_post() silently falls back to mail.mt_note (internal note)
   which does not generate email notifications for followers.

2. The forward wizard add_forward() creates a tier.review for the
   target user but never calls message_subscribe(). Without being a
   follower of the record, the target user cannot receive any email
   notifications — even if the subtype were correct.

Combined effect: when a reviewer forwards their approval to another
user, the target user is never notified and the forward appears to
"not work" from the end-user perspective.

Fixes:
- Correct the module prefix in _get_forwarded_notification_subtype()
- Call message_subscribe() in add_forward() to subscribe the forward
  target as a follower with the forward notification subtype
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @kittiu,
some modules you are maintaining are being modified, check this out!

@Saran440 Saran440 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code Review 👍

@llabusch93 Could you change Title to add version, please?
[18.0][FIX] base.....

@llabusch93 llabusch93 changed the title [FIX] base_tier_validation_forward: fix forward notification delivery [18.0][FIX] base_tier_validation_forward: fix forward notification delivery Jun 8, 2026
@llabusch93

Copy link
Copy Markdown
Author

@Saran440 Done — updated the title to [18.0][FIX] base_tier_validation_forward: fix forward notification delivery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants