Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2428 มุมมอง

I want to create an account when I send data as a POST request I get an error.

ex : 

client.callController('${domain}/web/signup', {       

 "login":'tete1',       

 "name":'tete13232',       

 "password":'123',        

"confirm_password":'123'     

 });

อวตาร
ละทิ้ง
ผู้เขียน

thanks for answer 


คำตอบที่ดีที่สุด

What you're trying to achieve probably won't be possible without providing a valid csrf_token. Most web forms nowadays use this for security reasons. You could try to use RPC calls on the signup​ method in the res.users​ model in the auth_signup​ module (see res_users.py). But I haven't tested this, it's just a suggestion that might point you in the right direction. Also make sure that uninvited users may sign up in the settings of Odoo.

For RPC calls to an Odoo database in Flutter I also suggest - if you don't already - to look at the Odoo RPC Client Library (https://pub.dev/packages/odoo_rpc). Personally I have good experience with this library. Using above suggestion would look something like this:

var res = await client.callKw({
'model': 'res.users',
'method': 'signup',
'args': [],
'kwargs': {
'values': {'name': 'tete13232', ...},
},
});

I hope this helps

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ธ.ค. 24
1756
API Problem in data return แก้ไขแล้ว
2
มิ.ย. 22
2684
1
ก.พ. 22
3664
1
ก.พ. 22
6450
0
พ.ย. 21
4083