Community mailing list archives

Re: how to create user using rpc calls

Rakesh Sindhav
- 06/26/2016 08:33:35
Hello Robert,

I think you forgot some required fields while to pass in "create()" function like
'login' field value.

Pass required arguments in create() method, It will solve your issue.

On Sat, Jun 25, 2016 at 1:46 PM, robert rottermann <> wrote:
thanks Nhomar,
On 24.06.2016 09:07, Nhomar Hernandez wrote:

On Fri, Jun 24, 2016 at 12:23 AM, robert rottermann <> wrote:
It is for odoorpc I would like to get a sample how to create a user

You can set Model and then use normally a create (as if you were inside Odoo).


Where Model is a res.users (as in the link)
not that easy:
here my script:

# -*- encoding: utf-8 -*-
import odoorpc
odoo = odoorpc.ODOO('localhost', port=8069)
odoo.login('afbstest', 'admin', 'admin')
User = odoo.env['res.users']
User.create({'name':'hans', 'is_company' : False})

# -----------------------------------------
this is the result:

robert@chrissy:~/projects/afbs$ bin/python scripts/
Traceback (most recent call last):
  File "scripts/", line 9, in <module>
    User.create({'name':'hans', 'is_company' : False})
  File "/home/robert/projects/afbs/python/local/lib/python2.7/site-packages/odoorpc/", line 74, in rpc_method
    cls._name, method, args, kwargs)
  File "/home/robert/projects/afbs/python/local/lib/python2.7/site-packages/odoorpc/", line 469, in execute_kw
    'args': args_to_send})
  File "/home/robert/projects/afbs/python/local/lib/python2.7/site-packages/odoorpc/", line 268, in json
odoorpc.error.RPCError: You cannot create a new user from here.
 To create new user please go to configuration panel.
Go to the configuration panel
# -----------------------------------------

so still in search of a sample

Nhomar Hernandez
CEO Vauxoo.
Twitter: @nhomar
Odoo Gold Partner
Skype: nhomar00 (Envia mail previo no lo superviso siempre).
Móvil Venezuela:
+58 4144110269
Móvil México:
+52 1 4773933942

Post to:

Post to:

Rakesh Sindhav