Skip to content
Snippets Groups Projects
Commit d05c8136 authored by Olivier Dony's avatar Olivier Dony
Browse files

[FIX] mail: mute default password warning on demo databases


The point is to warn admins of production and public-facing databases.
However it is not necessary to nag users of demo databases, even when
connecting non-locally (e.g. on runbot).

Updates #37580

(manual) forward-port of #48689

closes odoo/odoo#48691

Signed-off-by: default avatarOlivier Dony (odo) <odo@openerp.com>
parent ae610d0e
Branches
Tags
No related merge requests found
......@@ -20,6 +20,9 @@ def _admin_password_warn(uid):
admin = request.env.ref('base.partner_admin')
if uid not in admin.user_ids.ids:
return
has_demo = bool(request.env['ir.module.module'].sudo().search_count([('demo', '=', True)]))
if has_demo:
return
user = request.env(user=uid)['res.users']
MailChannel = request.env(user=SUPERUSER_ID, context=user.context_get(), su=True)['mail.channel']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment