From 6e86a66a876f2ce5e47a13d16e45aaa913a7e369 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 8 Apr 2014 09:38:19 +0200 Subject: [PATCH] Write needs list to browse. --- users_ldap_groups/users_ldap_groups.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/users_ldap_groups/users_ldap_groups.py b/users_ldap_groups/users_ldap_groups.py index 59421f924..71db80338 100644 --- a/users_ldap_groups/users_ldap_groups.py +++ b/users_ldap_groups/users_ldap_groups.py @@ -83,7 +83,7 @@ class CompanyLDAP(orm.Model): conf_all=self.read(cr, uid, conf['id'], ['only_ldap_groups']) if(conf_all['only_ldap_groups']): logger.debug('deleting all groups from user %d' % user_id) - userobj.write(cr, uid, user_id, {'groups_id': [(5, )]}) + userobj.write(cr, uid, [user_id], {'groups_id': [(5, )]}) for mapping in mappingobj.read(cr, uid, mappingobj.search(cr, uid, [('ldap_id', '=', conf['id'])]), []): @@ -93,6 +93,6 @@ class CompanyLDAP(orm.Model): mapping['value'], conf, self, logger): logger.debug('adding user %d to group %s' % (user_id, mapping['group'][1])) - userobj.write(cr, uid, user_id, + userobj.write(cr, uid, [user_id], {'groups_id': [(4, mapping['group'][0])]}) return user_id