FIX mail_outbound_static using sudo to get ir.config_parameter, otherwise when normal users try to send email they get AccessError

pull/575/head
eLBati 2020-07-22 12:26:59 +02:00
parent 8bd98212b8
commit 4fa8fda51a
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ class IrMailServer(models.Model):
email_from = mail_server.smtp_from email_from = mail_server.smtp_from
message.replace_header('From', email_from) message.replace_header('From', email_from)
bounce_alias = self.env['ir.config_parameter'].get_param( bounce_alias = self.env['ir.config_parameter'].sudo().get_param(
"mail.bounce.alias") "mail.bounce.alias")
if not bounce_alias: if not bounce_alias:
# then, bounce handling is disabled and we want # then, bounce handling is disabled and we want