Skip to content

[18.0][MIG] base_user_effective_permissions: Migration to 18.0#354

Merged
OCA-git-bot merged 6 commits intoOCA:18.0from
HeliconiaIO:18.0-mig-base_user_effective_permissions
Mar 13, 2026
Merged

[18.0][MIG] base_user_effective_permissions: Migration to 18.0#354
OCA-git-bot merged 6 commits intoOCA:18.0from
HeliconiaIO:18.0-mig-base_user_effective_permissions

Conversation

@BhaveshHeliconia
Copy link
Copy Markdown
Contributor

No description provided.

@BhaveshHeliconia BhaveshHeliconia mentioned this pull request Apr 28, 2025
14 tasks
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-base_user_effective_permissions branch 2 times, most recently from e61b84b to d35c607 Compare April 29, 2025 07:11
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-base_user_effective_permissions branch from d35c607 to aedf873 Compare April 29, 2025 10:33
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-base_user_effective_permissions branch from aedf873 to ab6a1ae Compare July 25, 2025 06:57
@github-actions
Copy link
Copy Markdown

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Nov 23, 2025
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-base_user_effective_permissions branch from ab6a1ae to 11a0a46 Compare November 25, 2025 06:28
@BhaveshHeliconia
Copy link
Copy Markdown
Contributor Author

Hey @OCA/tools-maintainers would be great if someone could have a look at this module.

@legalsylvain
Copy link
Copy Markdown
Contributor

@hbrunn : could you take a look on this migration ?

Copy link
Copy Markdown
Member

@hbrunn hbrunn left a comment

Choose a reason for hiding this comment

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

/ocabot migration base_user_effective_permissions

Comment thread base_user_effective_permissions/models/res_users_effective_permission.py Outdated
vals[f"{operation}_permission"] = True
except Exception:
vals[f"{operation}_permission"] = False
try:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you didn't answer this question

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The _compute_domain() method can raise an AccessError when:

  1. The user doesn't have access to certain ir.rule records
  2. Domain evaluation fails due to missing fields or invalid domain syntax
  3. 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

obvious copy&paste from coding assistant, no interest to continue discussion

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@hbrunn From my side I would say that this comment is addressed by catching only AccessError?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it's nonsense to catch any error here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Nov 25, 2025
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-base_user_effective_permissions branch from 11a0a46 to 1f9939e Compare November 26, 2025 04:19
@BhaveshHeliconia
Copy link
Copy Markdown
Contributor Author

@hbrunn : I’ve made the changes as per your suggestion. Could you please review? Thanks!”

@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-base_user_effective_permissions branch from 1f9939e to 2e88e57 Compare November 26, 2025 10:49
@github-actions github-actions Bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Nov 30, 2025
Comment thread base_user_effective_permissions/= Outdated
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-base_user_effective_permissions branch from 2e88e57 to 22f01e9 Compare February 26, 2026 04:21
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-base_user_effective_permissions branch from 22f01e9 to e0fe679 Compare March 6, 2026 08:13
Copy link
Copy Markdown
Member

@hbrunn hbrunn left a comment

Choose a reason for hiding this comment

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

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

@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-base_user_effective_permissions branch from e0fe679 to 910fbd2 Compare March 9, 2026 08:16
@BhaveshHeliconia
Copy link
Copy Markdown
Contributor Author

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

Thanks for pointing this out. Please have another look when you get a chance.

@BhaveshHeliconia BhaveshHeliconia requested a review from hbrunn March 13, 2026 03:02
@hbrunn hbrunn requested a review from yvaucher March 13, 2026 14:59
@yvaucher
Copy link
Copy Markdown
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 18.0-ocabot-merge-pr-354-by-yvaucher-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 4875900 into OCA:18.0 Mar 13, 2026
7 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

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

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.

7 participants