-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[ADD] Added module password_change_restrict. #249
[ADD] Added module password_change_restrict. #249
Conversation
This module allow only admin and users within Access Rights to change passwords, disallowing the rest.
Is posible add unitest? |
The module name should begin with |
class ResUsers(models.Model): | ||
_inherit = 'res.users' | ||
|
||
SELF_WRITEABLE_FIELDS = ['signature', 'action_id', 'company_id', 'email', |
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.
don't do this, remove the field in _register_hook
- otherwise we loose all changes from other modules in the inheritance chain
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.
In _register_hook
or __init__
? (I see other examples expanding SELF_WRITEABLE_FIELDS in __init__
)
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.
that shouldn't matter too much in this case. Generally, _register_hook
is safer because your model is fully loaded (relevant if you need to look up stuff in the db, patch fields, etc)
@moylop260 As soon as I fixed @hbrunn recommendations, I will try to do tests. |
[8.0][FIX] web_group_expand - Fix OCA#249
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. |
This module allow only admin and users within Access Rights to change passwords, disallowing the rest.