Skip to content
Snippets Groups Projects
Commit 48e94a6e authored by Thibault Delavallée's avatar Thibault Delavallée
Browse files

[FIX] digest: ensure cron sends all ready digests

Currently only digest planned "today" are sent. Which means that digest that
missed a cron tick are not sent anymore. We fix that by making the cron run
on all digest whose scheduled date is in the past or today.

LINKS

Task ID 2197417
PR odoo/odoo#51619
parent e1432afd
No related branches found
No related tags found
No related merge requests found
......@@ -196,7 +196,7 @@ class Digest(models.Model):
@api.model
def _cron_send_digest_email(self):
digests = self.search([('next_run_date', '=', fields.Date.today()), ('state', '=', 'activated')])
digests = self.search([('next_run_date', '<=', fields.Date.today()), ('state', '=', 'activated')])
for digest in digests:
try:
digest.action_send()
......
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