diff options
| author | Olivier Dony <odo@odoo.com> | 2020-03-31 21:36:01 +0000 |
|---|---|---|
| committer | Olivier Dony <odo@odoo.com> | 2020-04-01 00:07:31 +0000 |
| commit | d05c81365347b1e61f9ff09d3d0005c8788bc060 (patch) | |
| tree | 1367d6d531c4b4664906df3fdaf98a3a4877a2a7 /addons/mail/controllers | |
| parent | ae610d0e205da921111b5a320dec833d84b05056 (diff) | |
[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: Olivier Dony (odo) <odo@openerp.com>
Diffstat (limited to 'addons/mail/controllers')
| -rw-r--r-- | addons/mail/controllers/home.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/mail/controllers/home.py b/addons/mail/controllers/home.py index 9d54b6ebd1c..d3d293f29f2 100644 --- a/addons/mail/controllers/home.py +++ b/addons/mail/controllers/home.py @@ -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'] |
