[18.0][MIG] base_user_effective_permissions: Migration to 18.0#354
Conversation
e61b84b to
d35c607
Compare
d35c607 to
aedf873
Compare
aedf873 to
ab6a1ae
Compare
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
Currently translated at 100.0% (26 of 26 strings) Translation: server-backend-16.0/server-backend-16.0-base_user_effective_permissions Translate-URL: https://translation.odoo-community.org/projects/server-backend-16-0/server-backend-16-0-base_user_effective_permissions/it/
ab6a1ae to
11a0a46
Compare
|
Hey @OCA/tools-maintainers would be great if someone could have a look at this module. |
|
@hbrunn : could you take a look on this migration ? |
hbrunn
left a comment
There was a problem hiding this comment.
/ocabot migration base_user_effective_permissions
| vals[f"{operation}_permission"] = True | ||
| except Exception: | ||
| vals[f"{operation}_permission"] = False | ||
| try: |
There was a problem hiding this comment.
under which conditions is this expected to raise? I'd expect something to be very wrong when this happens, and then we shouldn't squelch the exception
There was a problem hiding this comment.
The _compute_domain() method can raise an AccessError when:
- The user doesn't have access to certain ir.rule records
- Domain evaluation fails due to missing fields or invalid domain syntax
- Security restrictions prevent domain computation for specific models
In these cases, setting an empty domain "[]" is appropriate as it indicates no domain-based restrictions beyond the basic access rights check already performed by ir.model.access#check.
However, you're right that we shouldn't squelch all exceptions. I'll update the code to catch only AccessError
There was a problem hiding this comment.
obvious copy&paste from coding assistant, no interest to continue discussion
There was a problem hiding this comment.
@hbrunn here I accept that I used AI but its only to clean up the wording, since sometimes I struggle to words things well. Sorry if that caused any confusion.
Next onwards I will try to best to answer well.
There was a problem hiding this comment.
@hbrunn From my side I would say that this comment is addressed by catching only AccessError?
There was a problem hiding this comment.
it's nonsense to catch any error here
There was a problem hiding this comment.
to better mimic what Odoo does this could however not call _compute_domain at all if vals[f"{operation}_permission"] is False, and do all of this in the same loop anyways
11a0a46 to
1f9939e
Compare
|
@hbrunn : I’ve made the changes as per your suggestion. Could you please review? Thanks!” |
1f9939e to
2e88e57
Compare
2e88e57 to
22f01e9
Compare
22f01e9 to
e0fe679
Compare
hbrunn
left a comment
There was a problem hiding this comment.
thanks for sanitizing the loop. remaining issue is that the domain widget crashes on some permission records, I suspect you need to filter out cases where model._abstract is True
e0fe679 to
910fbd2
Compare
Thanks for pointing this out. Please have another look when you get a chance. |
|
/ocabot merge nobump |
|
What a great day to merge this nice PR. Let's do it! |
|
Congratulations, your PR was merged at 4e0e191. Thanks a lot for contributing to OCA. ❤️ |
No description provided.