openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #06900
[Merge] lp:~openerp-dev/openobject-server/trunk-bug-751677-ysa into lp:openobject-server
Yogesh(Open ERP) has proposed merging lp:~openerp-dev/openobject-server/trunk-bug-751677-ysa into lp:openobject-server.
Requested reviews:
Naresh(OpenERP) (nch-openerp)
Related bugs:
Bug #751677 in OpenERP Server: "Unable to add users with wizard"
https://bugs.launchpad.net/openobject-server/+bug/751677
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-bug-751677-ysa/+merge/61350
problem fix in add user using configuration wizard.
--
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-bug-751677-ysa/+merge/61350
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-server/trunk-bug-751677-ysa.
=== modified file 'openerp/addons/base/res/res_user.py'
--- openerp/addons/base/res/res_user.py 2011-05-06 09:37:04 +0000
+++ openerp/addons/base/res/res_user.py 2011-05-18 05:38:23 +0000
@@ -206,6 +206,9 @@
raise osv.except_osv(_('Operation Canceled'), _('Please use the change password wizard (in User Preferences or User menu) to change your own password.'))
self.write(cr, uid, id, {'password': value})
+ def _get_password(self, cr, uid, ids, arg, karg, context=None):
+ return dict.fromkeys(ids, '')
+
_columns = {
'name': fields.char('User Name', size=64, required=True, select=True,
help="The new user's real name, used for searching"
@@ -213,7 +216,7 @@
'login': fields.char('Login', size=64, required=True,
help="Used to log into the system"),
'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."),
- 'new_password': fields.function(lambda *a:'', method=True, type='char', size=64,
+ 'new_password': fields.function(_get_password, method=True, type='char', size=64,
fnct_inv=_set_new_password,
string='Change password', help="Only specify a value if you want to change the user password. "
"This user will have to logout and login again!"),
@@ -263,7 +266,6 @@
if 'password' in o and ( 'id' not in o or o['id'] != uid ):
o['password'] = '********'
return o
-
result = super(users, self).read(cr, uid, ids, fields, context, load)
canwrite = self.pool.get('ir.model.access').check(cr, uid, 'res.users', 'write', raise_exception=False)
if not canwrite:
@@ -535,15 +537,17 @@
'email': base_data['email'],
'partner_id': partner_id,},
context)
- user_data = dict(
- base_data,
- signature=self._generate_signature(
- cr, base_data['name'], base_data['email'], context=context),
- address_id=address,
- )
+ base_data.update({'menu_id' : base_data.get('menu_id',False) and base_data['menu_id'][0],
+ 'company_id' : base_data.get('company_id',False) and base_data['company_id'][0],
+ 'action_id' : base_data.get('action_id',False) and base_data['action_id'][0],
+ 'signature' : self._generate_signature(cr, base_data['name'], base_data['email'], context=context),
+ 'address_id' : address,
+ 'groups_id' : [(6,0, base_data.get('groups_id',[]))],
+ })
new_user = self.pool.get('res.users').create(
- cr, uid, user_data, context)
+ cr, uid, base_data, context)
self.send_welcome_email(cr, uid, new_user, context=context)
+
def execute(self, cr, uid, ids, context=None):
'Do nothing on execution, just launch the next action/todo'
pass
Follow ups