8000 [19.0][FIX] scheduler_error_mailer: error mail has no recipient by bosd · Pull Request #3818 · OCA/server-tools · GitHub
[go: up one dir, main page]

Skip to content

[19.0][FIX] scheduler_error_mailer: error mail has no recipient - #3818

Open
bosd wants to merge 1 commit into
OCA:19.0from
bosd:19.0-fix-scheduler_error_mailer-use_default_to
Open

bosd wants to merge 1 commit into
OCA:19.0from
bosd:19.0-fix-scheduler_error_mailer-use_default_to

Conversation

@bosd
@bosd bosd commented Oct 27, 2026
Copy link
Copy Markdown

Problem
On 19.0 the scheduler error mail is generated without any recipient, so nobody is ever notified of a failing scheduled action.

Cause
mail.template.use_default_to defaults to True in 19.0. With it set, the template ignores email_to and uses the record's default recipients (_message_get_default_recipients). ir.cron has none, so email_to ends up empty and recipient_ids is empty.

Fix

  • Set use_default_to to False on the Scheduler Error template.
  • The template data is noupdate, so existing databases get the same change through a post-migration in migrations/19.0.1.0.1/. That is the version the bot will set on merge with a patch bump; the manifest version is left unchanged in this PR.

Verification

  • New test test_error_mail_recipient: a simulated cron failure produces a mail addressed to the cron user's email, and the template has use_default_to = False. It fails without the data change and passes with it; the existing tests still pass.
  • Observed on a production 19.0 database: the template had use_default_to = True and the error mails reached no one.

On 19.0, mail.template.use_default_to defaults to True. With it set the
template ignores email_to and takes the record's default recipients, and
ir.cron has none, so the scheduler error mail was generated without any
recipient. Disable use_default_to on the template, and on existing
databases through a post-migration since the data is noupdate.
@OCA-git-bot OCA-git-bot added series:19.0 mod:scheduler_error_mailer Module scheduler_error_mailer labels Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:scheduler_error_mailer Module scheduler_error_mailer series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0