Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Create Users Via API?

on 5/14/15, 12:35 PM 985 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


Jusab Sida (jsi)

--Jusab Sida (jsi)--
Tiny ERP Pvt Ltd
| 2 1 5
Gandhinagar, India
--Jusab Sida (jsi)--

Jusab Sida (jsi)
On 5/15/15, 6:51 AM

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.

On 9/21/15, 10:23 AM

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

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")

Hans van den Elsen
on 11/29/15, 1:25 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 5/14/15, 12:35 PM
Seen: 985 times
Last updated: 9/21/15, 10:23 AM