Closed naitikvithlani closed 6 years ago
@naitikvithlani
If you're developing an offline app, you should prevent this online server calls. Add res.groups
model in app and check access rights offline.
@KasimSCS I am developing app using jsonrpc(online)
@naitikvithlani
If you've already managed to use jsonrpc
already. then check out OSyncAdapter.java
and OSyncDataUtils.java
.
for e.g. if you've created one record offline at android device then Odoo-mobile/framework
is creating same record at server using OdooWrapper.java::callMethod
function by passing model
, method
, and args
value as parameter. Note that in odoo
some methods are @api.model
and some are @api.multi
.
Use callMethod
, get the error, trace the error. solve the error. That is the way.
@KasimSCS Thanks for your support, but i am not using any application which is provided by odoo.
I am developing my customised application using jsonrpc using volley as per my requirements, which is not based on [odoo-mobile/framework], so here i don't have any odoo classes.
So, i am stuck with check res.groups of login user.
@naitikvithlani
odoo
has defined the route name call_kw
. you can use call_kw
for calling has_groups
method of res.users
model. has_group
is @api.model
so, you need to send string
of whichever groups you want to check and that's it. :)
@KasimSCS Thanks
@naitikvithlani
You can close the issue if this works for you.
Thanks.
@KasimSCS I try to make as you suggested but not able to get groups details, It would be great if you can share some sample code to make it possible.
Thanks in advance.
@naitikvithlani Have a look a screenshot. Thanks
@KasimSCS Is there any way to add group by clause in jsonrpc request (as above screenshot attached) ?
Hello @kasimscs, I am developing app using jsonrpc(online) app, anyone can help me for know the server configuration of odoo server for 1K users of this app.
I guess 20 core server with 32GB RAM will enough for this ?
Hello All,
I am trying to check user's group through the application.
The way i found is check 'res_groups_users_rel' and then check the 'res_groups' for checking the user's groups.
Is there any way to call predefined method 'user_has_groups' of odoo from the application ?