From a37214d7ba32334f2fe93c94afbb0a016171eb46 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 6 Jun 2023 11:55:08 +0000 Subject: [PATCH] [FIX] portal: revoke regular portal users for real When we revoke a user's portal permissions the user type will be changed to public and be archived. There was an intended exception to check that if the user had more groups than just the portal one we would keep the user active. But there are many groups that the user will have by default when we install common apps like account, sale, etc. TT43708 closes odoo/odoo#132404 X-original-commit: 96a5a12a8c277f3774520082d799a22577e00ebe Signed-off-by: Thibault Delavallee (tde) --- addons/portal/wizard/portal_wizard.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py index 03380cca017..7d8e5f8c903 100644 --- a/addons/portal/wizard/portal_wizard.py +++ b/addons/portal/wizard/portal_wizard.py @@ -183,11 +183,7 @@ class PortalWizardUser(models.TransientModel): # remove the user from the portal group if user_sudo and user_sudo.has_group('base.group_portal'): - # if user belongs to portal only, deactivate it - if len(user_sudo.groups_id) <= 1: - user_sudo.write({'groups_id': [(3, group_portal.id), (4, group_public.id)], 'active': False}) - else: - user_sudo.write({'groups_id': [(3, group_portal.id), (4, group_public.id)]}) + user_sudo.write({'groups_id': [(3, group_portal.id), (4, group_public.id)], 'active': False}) return self.action_refresh_modal()