Odoo Help


Register a user using the API

Hans van den Elsen
on 11/29/15, 1:44 PM 589 views

I'm creating a RESTful API using PHP to distribute all my requests to the right place (one of them is Odoo).

So I was using the API reference and I'm trying to register a user using the API.

The request is made using:
$id = $model->execute_kw($db, $uid, $pass, 'res.users', 'create', [['name' => $data->fullName, 'login' => $data->username, 'new_password' => $data->password]]);

The response is: 
{"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)"}

The $model param is instantiated correctly, because I can use the 'search_read' action with success.

I'm fairly new to Odoo so go soft on me :).

Hans van den Elsen
On 11/29/15, 3:47 PM

I finally found the problem to this issue. The field new_password should have been just password.
I'm not pleased that Odoo responds with a message so vague. But anyway, my evening has been saved. Sorry to bother you.
I'll keep the answer here.

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 platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 11/29/15, 1:44 PM
Seen: 589 times
Last updated: 11/29/15, 8:38 PM