[FIX] base: require wizard for passwd change

This commit is contained in:
Olivier Dony
2016-04-01 20:42:50 +02:00
parent b2c20482c0
commit e2d0f1e974
+2 -2
View File
@@ -285,7 +285,7 @@ class res_users(osv.osv):
}
# User can write on a few of his own fields (but not his groups for example)
SELF_WRITEABLE_FIELDS = ['password', 'signature', 'action_id', 'company_id', 'email', 'name', 'image', 'image_medium', 'image_small', 'lang', 'tz']
SELF_WRITEABLE_FIELDS = ['signature', 'action_id', 'company_id', 'email', 'name', 'image', 'image_medium', 'image_small', 'lang', 'tz']
# User can read a few of his own fields
SELF_READABLE_FIELDS = ['signature', 'company_id', 'login', 'email', 'name', 'image', 'image_medium', 'image_small', 'lang', 'tz', 'tz_offset', 'groups_id', 'partner_id', '__last_update', 'action_id']
@@ -521,7 +521,7 @@ class res_users(osv.osv):
"""
self.check(cr.dbname, uid, old_passwd)
if new_passwd:
return self.write(cr, uid, uid, {'password': new_passwd})
return self.write(cr, SUPERUSER_ID, uid, {'password': new_passwd})
raise UserError(_("Setting empty passwords is not allowed for security reasons!"))
def preference_save(self, cr, uid, ids, context=None):