Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0] [IMP] mass_mailing: patch to allow slicing of remaing recipients #94

Draft
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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