-
-
Notifications
You must be signed in to change notification settings - Fork 633
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
Conversation
There was a problem hiding this 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
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 | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | |
): |
_( | ||
"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 | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_( | |
"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")), | |
) |
There was a problem hiding this 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review.
class MailActivityType(models.Model): | ||
_inherit = "mail.activity.type" | ||
|
||
category = fields.Selection(selection_add=[("validation", "Validation")]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an ondelete property
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. |
Forward-port of: