How to connect odoo with flutter app, using odoo_api ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
2
Trả lời
24783
Lượt xem
main() {
var client = OdooClient("demo server");
client.connect().then((version) {
print("Connected $version");
});
var conectd = client.authenticate("username","password","Database");
print ("$conectd coonection object");
}
I had seen the odoo_api. the code above explains the connection . But unfortunately I got the "Instance of 'Future<AuthenticateCallback>'" when I print it. Could you please explain how to read the records from database
HI,
If you haven't seen this link yet, see: Odoo Flutter API
Authentication:
Future<AuthenticateCallback> authenticate(
String username, String password, String database) async {
var url = createPath("/web/session/authenticate");
var params = {
"db": database,
"login": username,
"password": password,
"context": {}
};
final response = await callRequest(url, createPayload(params));
final session = await getSessionInfo();
return new AuthenticateCallback(
!response.hasError(), response, session.getSessionId());
}
callKW method
Future<OdooResponse> callKW(String model, String method, List args,
{dynamic kwargs, Map context}) async {
kwargs = kwargs == null ? {} : kwargs;
context = context == null ? {} : context;
var url = createPath("/web/dataset/call_kw/" + model + "/" + method);
var params = {
"model": model,
"method": method,
"args": args,
"kwargs": kwargs,
"context": context
};
return await callRequest(url, createPayload(params));
}
Also you can check this blog: https://www.cybrosys.com/blog/how-to-integrate-odoo-with-android-using-oogbox-mobile-api
Thanks
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký