[FIX] 13.0 mail_outbound_static

use sudo to get ir.config_parameter, otherwise when normal users try to
send email they get AccessError
This commit is contained in:
eLBati 2020-07-22 12:26:59 +02:00 committed by Maksym Yankin
parent a89af4c4ff
commit 4c2f1c6e1b

View File

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