Community mailing list archives

solved: Re: how to create user using rpc calls

redCOR AG, robert rottermann
- 06/25/2016 05:14:01
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)

Thanks Yaseen,
On 25.06.2016 10:41, Yaseen Shareef wrote:
Hi Guys,

Please find the attached script

Thanks And Regards,
Yaseen Shareef

Odoo Developer/ Consultant
Skype: yaseen.shareef91

with your help I fixed my script.
what it needed was a login parameter ..

here is the running script in its full splendour:

# -*- encoding: utf-8 -*-
import sys
import odoorpc

odoo = odoorpc.ODOO('localhost', port=8069)
odoo.login('afbstest', 'admin', 'admin')
User = odoo.env['res.users']

User.create({'login':'hans','name':'hans', 'is_company' : False})