diff --git a/addons/mass_mailing/models/mailing.py b/addons/mass_mailing/models/mailing.py index 15c290469cef8..4ab44bd0b4a05 100644 --- a/addons/mass_mailing/models/mailing.py +++ b/addons/mass_mailing/models/mailing.py @@ -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):