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

[17.0][MIG] mail_activity_validation: Migration to 17.0 #1336

Closed

Conversation

yankinmax
Copy link
Contributor

Copy link

@SilvioC2C SilvioC2C left a comment

Choose a reason for hiding this comment

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

Pre-approving:

  • minor remarks for better readability
  • please add some unit tests

Comment on lines +12 to +21
group_intersect = False
if set(self.env.user.groups_id) | set(
self.activity_type_id.validator_group_ids
):
group_intersect = True
if (
self.activity_type_id.category != "validation"
or not self.activity_type_id.validator_group_ids
or group_intersect
):

Choose a reason for hiding this comment

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

Suggested change
group_intersect = False
if set(self.env.user.groups_id) | set(
self.activity_type_id.validator_group_ids
):
group_intersect = True
if (
self.activity_type_id.category != "validation"
or not self.activity_type_id.validator_group_ids
or group_intersect
):
if (
self.activity_type_id.category != "validation"
or not self.activity_type_id.validator_group_ids
or self.env.user.groups_id & self.activity_type_id.validator_group_ids
):

Comment on lines +25 to +31
_(
"Only validators in groups {} are " "allowed to validate this activity."
).format(
"\n".join(
g.display_name for g in self.activity_type_id.validator_group_ids
)
)

Choose a reason for hiding this comment

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

Suggested change
_(
"Only validators in groups {} are " "allowed to validate this activity."
).format(
"\n".join(
g.display_name for g in self.activity_type_id.validator_group_ids
)
)
_(
"Only validators in groups %s are allowed to validate this activity.",
", ".join(self.activity_type_id.validator_group_ids.mapped("display_name")),
)

Copy link
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.

I agree with @SilvioC2C's remarks, and no tests at all makes me disinclined to merge this

Copy link
Contributor

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

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

Code review.

@yankinmax

class MailActivityType(models.Model):
_inherit = "mail.activity.type"

category = fields.Selection(selection_add=[("validation", "Validation")])
Copy link
Contributor

Choose a reason for hiding this comment

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

Add an ondelete property

Copy link

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 Aug 18, 2024
@github-actions github-actions bot closed this Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs fixing stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants