Repository navigation
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_todefaults toTruein 19.0. With it set, the template ignoresemail_toand uses the record's default recipients (_message_get_default_recipients).ir.cronhas none, soemail_toends up empty andrecipient_idsis empty.Fix
use_default_totoFalseon the Scheduler Error template.noupdate, so existing databases get the same change through a post-migration inmigrations/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
test_error_mail_recipient: a simulated cron failure produces a mail addressed to the cron user's email, and the template hasuse_default_to = False. It fails without the data change and passes with it; the existing tests still pass.use_default_to = Trueand the error mails reached no one.