Skip to content

Commit

Permalink
[IMP]base_tier_validation: only post notifications to reciepients
Browse files Browse the repository at this point in the history
  • Loading branch information
bosd committed Oct 22, 2023
1 parent 4604e4a commit 4be2934
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions base_tier_validation/models/tier_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,14 @@ def _notify_review_requested(self, tier_reviews):
lambda r: r.definition_id.notify_on_create and r.res_id == rec.id
).mapped("reviewer_ids")
# Subscribe reviewers and notify
getattr(rec, subscribe)(
partner_ids=users_to_notify.mapped("partner_id").ids
)
getattr(rec, post)(
subtype_xmlid=self._get_requested_notification_subtype(),
body=rec._notify_requested_review_body(),
)
if len(users_to_notify) > 0:
getattr(rec, subscribe)(
partner_ids=users_to_notify.mapped("partner_id").ids
)
getattr(rec, post)(
subtype_xmlid=self._get_requested_notification_subtype(),
body=rec._notify_requested_review_body(),
)

def request_validation(self):
td_obj = self.env["tier.definition"]
Expand Down

0 comments on commit 4be2934

Please sign in to comment.