Community mailing list archives

community@mail.odoo.com

solved: Re: how to create user using rpc calls

by
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 <robert@redcor.ch> wrote:
It is for odoorpc I would like to get a sample how to create a user

http://pythonhosted.org/OdooRPC/ref_models.html

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

Model.create(dict)

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
mayashkhan@gmail.com
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:

#!bin/python
# -*- 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})