Skip to content

[18.0][IMP] base_tier_validation: support res.groups in addition to res.users in field-based validation #1081

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

Open
wants to merge 2 commits into
base: 18.0
Choose a base branch
from

Conversation

kevinkhao
Copy link
Contributor

@kevinkhao kevinkhao commented May 20, 2025

No description provided.

@OCA-git-bot
Copy link
Contributor

Hi @LoisRForgeFlow,
some modules you are maintaining are being modified, check this out!

@kevinkhao kevinkhao changed the title [IMP] base_tier_validation: support res.groups in addition to res.use… [IMP] base_tier_validation: support res.groups in addition to res.users in field-based validation May 20, 2025
@kevinkhao kevinkhao force-pushed the 18.0-base_tier_validation_group branch from 7e58ca6 to 6425290 Compare May 20, 2025 06:51
@kevinkhao kevinkhao force-pushed the 18.0-base_tier_validation_group branch from 6425290 to b0a4f98 Compare May 20, 2025 07:23
@kevinkhao kevinkhao force-pushed the 18.0-base_tier_validation_group branch 2 times, most recently from 0e382fc to f9db455 Compare May 20, 2025 07:33
return self.env["res.users"]

def _check_reviewers(self, resource):
if not resource or resource._name not in ["res.users", "res.groups"]:
Copy link
Member

Choose a reason for hiding this comment

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

You don't actually seem to pass groups here. Shouldn't resource always be res.users?

Copy link
Contributor

Choose a reason for hiding this comment

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

@kevinkhao Just a reminder that this review is still pending to attend

Copy link
Contributor Author

@kevinkhao kevinkhao Jul 10, 2025

Choose a reason for hiding this comment

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

right! @StefanRijnhart fixed/mini refactored here cc064b5

@LoisRForgeFlow LoisRForgeFlow changed the title [IMP] base_tier_validation: support res.groups in addition to res.users in field-based validation [18.0][IMP] base_tier_validation: support res.groups in addition to res.users in field-based validation Jun 30, 2025
@kevinkhao kevinkhao force-pushed the 18.0-base_tier_validation_group branch from 9f96b57 to cc064b5 Compare July 10, 2025 08:22
Copy link
Member

@StefanRijnhart StefanRijnhart 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 the changes so far! One remaining comment.

if reviewer_field_val._name == "res.users":
res = reviewer_field_val
if not res:
raise ValidationError(
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a line in your test to check this error can be raised successfully? Should make codecov happy.

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