import xmlrpclib
username = 'admin' #the user
pwd = 'admin'      #the password of the user
dbname = 'openerp' #the database
# Get the uid
sock_common = xmlrpclib.ServerProxy ('http://localhost:8069/xmlrpc/common')
uid = sock_common.login(dbname, username, pwd)
#replace localhost with the address of the server
sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object'
diki = {'id':1,'name':"myname",'model_id':1,'group_id': 1,'perm_read':0,'perm_write':1,'perm_create':0,'perm_unlink':1}
group = {
  'category_id': 1, # many2one
  'name': 'newgroup14', #simple field
  'implied_ids': [(6,0,[3, 2, 1])], #one2many
  'users' : [(6,0,[1])],
  'menu_access' : [(6,0,[1])], #many2many
  'view_access' : [(6,0,[1])],
  'comment' : 'chopito',
  'model_access' :diki
 
   } #many2many
#Read partner data
partner_id = sock.execute(dbname, uid, pwd, 'res.groups', 'create', group)
