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
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
2
Replies
23688
Views
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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up