This question has been flagged
2 Replies
12122 Views

I tried to create new users via XML-RPC but i got this error:

xmlrpclib.Fault: <Fault You cannot create a new user from here. 
To create new user please go to configuration panel.

I can import users creating new records directly in PgAdmin but I would like not do this.

Users can be created only manually? Or there's a way to create/import them in automatic way?

Any help is appreciated


Avatar
Discard
Best Answer

Hi Cole,

    It seems like you are gives data without 'login' fields.

At the time of creating user, odoo will check that data contain 'login' or not(i.e. this field must contain some data).

Can u check your values whatever u pass in create method.

let me inform if u got any problem...

Hope this will help you.

Avatar
Discard
Best Answer

import xmlrpclib

url = "http://localhost:8069"

db = "db"

username = 'admin'

password = 'admin'

common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url)

uid = common.authenticate(db, username, password, {})

models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url)

user_id=models.execute_kw(db, uid, password, 'res.users', 'create', [{'name':"user", 'login':'user@gmail.com',

'company_ids':[1], 'company_id':1, 'new_password':'12345'}])

print user_id

Avatar
Discard

If I try the this, I get {"faultCode":4,"faultString":"(u'The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\\n\\n(Document type: Users, Operation: write)', None)"}. Could you tell me what's going on? (The user has all rights to "res_users all")