Odoo Help

Welcome!

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.

0

Openerp xmlrpc PHP insert into re.users with company_id

By
Nicola Vanoni
on 6/19/14, 9:12 AM 2,379 views

im trying to insert in res.users with this code:

$values= array( "name"=>new xmlrpcval($name,"string"), "login"=>new xmlrpcval($login,"string"), "password"=>new xmlrpcval($psw,"string"), "lang"=>new xmlrpcval("it_IT","string"), "company_id"= new xmlrpcval($company,"many2one"); ); echo $id= $this->create($values,"res.users");

Im using a user with all the possible privileges...

The function return a -1 state that means that i ve no permission or the format is not corrected.

0
Nicola Vanoni
On 6/20/14, 4:58 AM

Hi, thx for the answer.

But i want to add a new user with a company_id different from the current user's company_id so i can't use the default value.

And the the webservice seems that don't let me do that.

 

0

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 6/19/14, 12:05 PM

Nicola,

If you want to insert the Current User's company to the new user record, do not do that. The _defaults already adds the current company by default.

If you want to create a new company, you have to make sure that your current user has enough permission to create the company.

Thanks.

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)

Stats

Asked: 6/19/14, 9:12 AM
Seen: 2379 times
Last updated: 3/16/15, 8:10 AM