Odoo-mobile / framework

Odoo Mobile Framework
https://play.google.com/store/apps/dev?id=8607973775002477408
Other
329 stars 374 forks source link

Call odoo server method, the ui was blocked #302

Open jiangzhixiao opened 7 years ago

jiangzhixiao commented 7 years ago

Hi all when i call an server method use the callMethod("test_method"), the test_method was called successs. but the anroid UI was blocked. for debug ,i have to uninstall the app and install the app everytime,it made me burst! i got this log from android debug console D/Volley: [90139] BasicNetwork.logSlowRequests: HTTP response for request=<[ ] http://192.168.0.101:8066/web/dataset/call_kw 0x85adf655 NORMAL 7> [lifetime=13084], [size=30], [rc=200], [retryCount=0] can anyone help me out? best regards

just now , i try these code OdooResult record = resPartner.getServerDataHelper().read(null, 1); it also can't get response from odoo server.

jiangzhixiao commented 7 years ago

@kasim1011 hi kasim,can you help me ?

kasim1011 commented 7 years ago

@jiangzhixiao For any kind of server call, please use AsyncTask or AsyncTaskLoader.

In my case I've called has_group method of res.users using AsyncTask.

Let's ask to @dpr-odoo for what to use for best practices.

jiangzhixiao commented 7 years ago

i resolve this issue i made big mistake. the android code should be write in AsyncTask method .

jiangzhixiao commented 7 years ago

@kasim1011 thanks for your reply kasim.i see your post just now .

jiangzhixiao commented 7 years ago

@dpr-odoo any other better solutions?