Skip to content
Snippets Groups Projects
Unverified Commit 17e144f5 authored by Martin Trigaux's avatar Martin Trigaux
Browse files

[FIX] mail,website_forum: set SELF_WRITABLE_FIELDS on model's class

Otherwise it is not visible when set on an instance of the new API.
self is a recordset instead of the model `res.users`

Without this patch a low priviledge user was not able to modify its own value
of `notify_email` through the preference window.
parent 91acf0ab
No related branches found
No related tags found
No related merge requests found
......@@ -27,11 +27,11 @@ class Users(models.Model):
"""
init_res = super(Users, self).__init__(pool, cr)
# duplicate list to avoid modifying the original reference
self.SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
self.SELF_WRITEABLE_FIELDS.extend(['notify_email'])
type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
type(self).SELF_WRITEABLE_FIELDS.extend(['notify_email'])
# duplicate list to avoid modifying the original reference
self.SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
self.SELF_READABLE_FIELDS.extend(['notify_email', 'alias_domain', 'alias_name'])
type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
type(self).SELF_READABLE_FIELDS.extend(['notify_email', 'alias_domain', 'alias_name'])
return init_res
def get_alias_model_name(self, vals):
......
......@@ -12,7 +12,7 @@ class Users(models.Model):
def __init__(self, pool, cr):
init_res = super(Users, self).__init__(pool, cr)
self.SELF_WRITEABLE_FIELDS = list(
type(self).SELF_WRITEABLE_FIELDS = list(
set(
self.SELF_WRITEABLE_FIELDS +
['country_id', 'city', 'website', 'website_description', 'website_published']))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment