New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] base: creation of portal user #30958

Open
wants to merge 1 commit into
base: 12.0
from

Conversation

Projects
None yet
5 participants
@jpp-odoo
Copy link
Contributor

jpp-odoo commented Feb 8, 2019

When creating a portal user from the User & Companies menu in the
Settings.

Before this commit, the created user had both groups' portal user and
internal user, which generated an error in the display of the user
accesses and rights. This also occurred if we manually add a portal
user to the internal user group.

Now, when creating a portal user, the user only has this group. Also,
if we manually add a portal user to the internal user group, an error
is raised to inform that only one user type is allowed.

OPW-1929367

@jpp-odoo

This comment has been minimized.

Copy link
Contributor Author

jpp-odoo commented Feb 8, 2019

@odony @KangOl please review.

@robodoo robodoo added the seen 🙂 label Feb 8, 2019

@jpp-odoo jpp-odoo force-pushed the odoo-dev:12.0-opw-1929367-user_type_manual_creation-jpp branch to b1e227e Feb 8, 2019

@C3POdoo C3POdoo added the OE label Feb 8, 2019

@jpp-odoo jpp-odoo force-pushed the odoo-dev:12.0-opw-1929367-user_type_manual_creation-jpp branch from b1e227e to 34248cf Feb 11, 2019

@robodoo robodoo added the CI 🤖 label Feb 11, 2019

@jpp-odoo jpp-odoo force-pushed the odoo-dev:12.0-opw-1929367-user_type_manual_creation-jpp branch from 34248cf to c309576 Feb 11, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Feb 11, 2019

@nim-odoo
Copy link
Contributor

nim-odoo left a comment

Just some minor technical comments from my side, since the functional PoV has been covered with @odony .

Show resolved Hide resolved odoo/addons/base/models/res_users.py Outdated
Show resolved Hide resolved odoo/addons/base/models/res_users.py Outdated
Show resolved Hide resolved odoo/addons/base/models/res_users.py Outdated
@@ -1178,6 +1216,15 @@ def _add_reified_groups(self, fields, values):
elif is_selection_groups(f):
selected = [gid for gid in get_selection_groups(f) if gid in gids]
values[f] = selected and selected[-1] or False
#When the user is in at least two groups of category == 'User types' (Internal User or Portal or Public)
#The selected value must be the group with the most access, ie : Internal User > Portal > Public

This comment has been minimized.

@nim-odoo

nim-odoo Feb 11, 2019

Contributor

what if a new User Type has been created manually?

Show resolved Hide resolved odoo/addons/base/models/res_users.py Outdated
Show resolved Hide resolved odoo/addons/base/models/res_users.py Outdated
Show resolved Hide resolved odoo/addons/base/models/res_users.py
Show resolved Hide resolved odoo/addons/base/models/res_users.py
[FIX] base: creation of portal user
When creating a portal user from the User & Companies menu in the
Settings.

Before this commit, the created user had both groups' portal user and
internal user, which generated an error in the display of the user
accesses and rights. This also occurred if we manually add a portal
user to the internal user group.

Now, when creating a portal user, the user only has this group. Also,
if we manually add a portal user to the internal user group, an error
is raised to inform that only one user type is allowed.

OPW-1929367

@jpp-odoo jpp-odoo force-pushed the odoo-dev:12.0-opw-1929367-user_type_manual_creation-jpp branch from c309576 to 2a3288e Feb 12, 2019

@robodoo robodoo removed the CI 🤖 label Feb 12, 2019

@jpp-odoo

This comment has been minimized.

Copy link
Contributor Author

jpp-odoo commented Feb 12, 2019

I made all the changes you asked for.

@robodoo robodoo added the CI 🤖 label Feb 12, 2019

@jpp-odoo

This comment has been minimized.

Copy link
Contributor Author

jpp-odoo commented Feb 18, 2019

@odony please review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment