Merge lp:~openerp-dev/openobject-server/6.0-opw-578249-res_users-rha into lp:openobject-server/6.0

Proposed by Rifakat Husen (OpenERP)
Status: Merged
Approved by: Naresh(OpenERP)
Approved revision: no longer in the source branch.
Merged at revision: 3652
Proposed branch: lp:~openerp-dev/openobject-server/6.0-opw-578249-res_users-rha
Merge into: lp:openobject-server/6.0
Diff against target: 22 lines (+4/-1)
1 file modified
bin/addons/base/res/res_user.py (+4/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/6.0-opw-578249-res_users-rha
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+121834@code.launchpad.net

Description of the change

Hello,

fields.function of res.users, new_password, returns lambda argument as blank string which is
wrong. Function field implementation should return dictionary.

Please review this fix.

Regards,
Rifakat Haradwala

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/base/res/res_user.py'
2--- bin/addons/base/res/res_user.py 2012-08-22 15:34:54 +0000
3+++ bin/addons/base/res/res_user.py 2013-01-03 09:16:26 +0000
4@@ -205,6 +205,9 @@
5 # will face unexpected 'Access Denied' exceptions.
6 raise osv.except_osv(_('Operation Canceled'), _('Please use the change password wizard (in User Preferences or User menu) to change your own password.'))
7 self.write(cr, uid, id, {'password': value})
8+
9+ def _get_password(self, cr, uid, ids, arg, karg, context=None):
10+ return dict.fromkeys(ids, '')
11
12 _columns = {
13 'name': fields.char('User Name', size=64, required=True, select=True,
14@@ -213,7 +216,7 @@
15 'login': fields.char('Login', size=64, required=True,
16 help="Used to log into the system"),
17 'password': fields.char('Password', size=64, invisible=True, help="Keep empty if you don't want the user to be able to connect on the system."),
18- 'new_password': fields.function(lambda *a:'', method=True, type='char', size=64,
19+ 'new_password': fields.function(_get_password, method=True, type='char', size=64,
20 fnct_inv=_set_new_password,
21 string='Change password', help="Only specify a value if you want to change the user password. "
22 "This user will have to logout and login again!"),