Skip to content
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

[16.0][IMP] attribute_set: Several improvements #171

Merged
merged 6 commits into from
Nov 16, 2023

Conversation

rousseldenis
Copy link
Contributor

@rousseldenis rousseldenis commented Oct 23, 2023

Includes commits of #170

Some fixes about access errors for normal users (without erp manager group). See commit messages for details.

rousseldenis and others added 5 commits October 23, 2023 12:01
…ss data (tree/search...)

Use get_view() to get the view_type directly. Moreover, this will allow to test it through
odoo.tests.Form().

Add attribute_set_id field in test form (as it should be included in inherited views
If user is not in the base.group_erp_manager group, the value_ref field
selection function will be computed without access rights on ir.model.
So, hide the field for users not in that group.
Add all the attributes defined for the model into the list of fields to load to display the form view. Wihout this change a JS error occurs when displaying the form view of a x2many field for a model defining attributes. The origin of the error comes from the the get_views method which is called for the type 'form' only. In this case it's important to add all the custom attributes to the list of fields defined on the model for the view. When the same method is called without restriction it will load all the views. Since odoo include all the fields defined on the model for the search view, the error doesn't occur when using the form view from a menu action.
As model_id is referring to non accessible models for
common users, set a related field in order to be able
to use it in views domains.

Moreover, add a domain on attribute_set_id field in
attribute owner mixin in order to simplify inherited
views.
As attribute view building is accessing ir.model records,
do it with sudo.
Copy link
Contributor

@simahawk simahawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

@simahawk
Copy link
Contributor

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-171-by-simahawk-bump-minor, awaiting test results.

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@OCA-git-bot OCA-git-bot merged commit 6ad255d into OCA:16.0 Nov 16, 2023
6 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at fc3988f. Thanks a lot for contributing to OCA. ❤️

lmignon pushed a commit to acsone/odoo-pim that referenced this pull request Nov 20, 2023
@lmignon lmignon deleted the 16.0-fix-rights-dro branch February 22, 2024 11:36
Vandan-OSI pushed a commit to ursais/odoo-pim that referenced this pull request Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants