Skip to content

Commit

Permalink
[IMP] mass_mailing: patch to allow slicing of remaing recipients
Browse files Browse the repository at this point in the history
  • Loading branch information
jdoutreloux committed May 15, 2024
1 parent 7a46010 commit dcdf042
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions addons/mass_mailing/models/mailing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,12 +1059,13 @@ def action_send_mail(self, res_ids=None):
# auto-commit except in testing mode
auto_commit = not getattr(threading.current_thread(), 'testing', False)
composer._action_send_mail(auto_commit=auto_commit)
mailing.write({
'state': 'done',
'sent_date': fields.Datetime.now(),
# send the KPI mail only if it's the first sending
'kpi_mail_required': not mailing.sent_date,
})
if not mailing._get_remaining_recipients():
mailing.write({
'state': 'done',
'sent_date': fields.Datetime.now(),
# send the KPI mail only if it's the first sending
'kpi_mail_required': not mailing.sent_date,
})
return True

def convert_links(self):
Expand Down

0 comments on commit dcdf042

Please sign in to comment.