From 0c7d16963bd63fae0fd86c1bee422824bec0981c Mon Sep 17 00:00:00 2001 From: Paul Morelle Date: Mon, 14 Sep 2020 12:55:11 +0000 Subject: [PATCH] [IMP] auth_signup: avoid disabled users to fail an installation When a module creates a disabled user during its installation or upgrade (e.g. demo data), the UserError "You cannot perform this action on an archived user" breaks the whole installation process. We don't care if the mail cannot be sent for users created by an installation, so let's just skip the whole function if we are installing a module. closes odoo/odoo#59036 X-original-commit: 78e22584c76c9fecbc22ab3604771fdce5f2094f Signed-off-by: Paul Morelle --- addons/auth_signup/models/res_users.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/auth_signup/models/res_users.py b/addons/auth_signup/models/res_users.py index 3aaa43f0f18..d93e7c7063f 100644 --- a/addons/auth_signup/models/res_users.py +++ b/addons/auth_signup/models/res_users.py @@ -164,6 +164,8 @@ class ResUsers(models.Model): def action_reset_password(self): """ create signup token for each user, and send their signup url by email """ + if self.env.context.get('install_mode', False): + return if self.filtered(lambda user: not user.active): raise UserError(_("You cannot perform this action on an archived user.")) # prepare reset password signup