From 3a95d2fdf8a7751276b88e0208be5ba3e181b62c Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 24 Aug 2018 10:58:18 +0200 Subject: [PATCH] [FIX] base: force comparison between strings When using another login method than stored password (ldpa,i oauth...), user's password is NULL in database. Passlib < 1.7 expect the encrypted password to be a string, leading to an uncaught traceback, forbidding login. --- odoo/addons/base/models/res_users.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/odoo/addons/base/models/res_users.py b/odoo/addons/base/models/res_users.py index ee3c0577845..ab5dd189e74 100644 --- a/odoo/addons/base/models/res_users.py +++ b/odoo/addons/base/models/res_users.py @@ -290,8 +290,9 @@ class Users(models.Model): @api.model def check_credentials(self, password): """ Override this method to plug additional authentication methods""" + assert password self.env.cr.execute( - 'SELECT password FROM res_users WHERE id=%s', + "SELECT COALESCE(password, '') FROM res_users WHERE id=%s", [self.env.user.id] ) [hashed] = self.env.cr.fetchone()