Skip to content
Snippets Groups Projects
Commit c0dd1e4f authored by Fabio Barbero's avatar Fabio Barbero
Browse files

[FIX] gamification: stop notifying users on intermediate ranks

Purpose
=======
Avoid sending lost of emails for new ranks rank for each user when
installing gamification module.

Emails are now only sent outside of module installation.

Task-2746929

X-original-commit: 5dc3b3ef
Part-of: odoo/odoo#89463
parent 7ce480b7
No related branches found
No related tags found
No related merge requests found
......@@ -180,6 +180,10 @@ WHERE sub.user_id IN %%s""" % {
"""
Method that can be called on a batch of users with the same new rank
"""
if self.env.context.get('install_mode', False):
# avoid sending emails in install mode (prevents spamming users when creating data ranks)
return
template = self.env.ref('gamification.mail_template_data_new_rank_reached', raise_if_not_found=False)
if template:
for u in self:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment