Is it possible to fetch users by city or country? I would like to create something very local!
I've checked the available documentation but fail to see any solution to this, so this is a final stretch.
The City and Country properties are not searchable with the provided q parameter in the API, and as this searches over username / description and title you'd return a large number of false positives if it could.
It's unlikely you could over select as mentioned in the comments, as there are just too many users to pull down and then parse.
Related
BASIC PROBLEM TO SOLVE
I am trying to configure flexible rules using user groups and ir.rules in Odoo 10. Basically I want to give users access only to certain records, based on specific values in columns. There are some records that I want to restrict - regardless if it was allowed in another group based on different criteria.
Here are some simplified examples of what I want to accomplish:
1.
(country = 'USA'
or
office= London)
and
vip = false
2.
(country = 'uk'
or
country = 'netherlands'
or
office = London)
etc
To make the access rules flexible, I want to create the following groups:
group_country_usa
group_country_germany
group_country_uk
group_country_netherlands
etc
group_office_london
group_office_new_york
group_office_paris
group_office_tokyo
group_office_st_petersburg
etc
group_no_vips
I have corresponding ir.rules records for each group above:
[('country','=', 'usa')]
etc
[('office','=', 'amsterdam')]
etc
[('vip','=', False)]
Per my testing I do not believe I can do the the above with only using separate ir.rules records.
Is there a way I can accomplish my objective?
I hope the above makes sense and that someone can hint me in the right direction.
Assuming there's a global rule allowing access to all records, I see no problem with using your described ir.rule and res.groups configuration. However, group rules are additive, meaning it is not possible to join ir.rule domains with and like in your example #1. See official docs for more information.
In my cloud search document I have list of persons I want to search in. Now, let's say there are a people with name David, Dan and Dennis. Everything works alright when I query full name (for example: David) - I get back all the persons with the name David. But what if I want to return all persons who's name starts with Da (so cloud search will leturn David, Dan and Dennis)? Is it possible to achieve this behaviour?
For context: I am building an application where user can search people by name (and some other attributes) and I don't want the user to have to type the full name of person to find...
Oh I found it. I need to use text prefiex:
https://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-text.html#searching-text-prefixes
I am performing a query using Google Places API to search for local restaurants
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=..lat,..lon&radius=..radius&type=restaurant&key=..key
However, I am receiving a lot of results for locations that are not primarily restaurants, for example:
Popular hotels with restaurants
Food delivery services
Night clubs
Department stores with dining
etc.
Ideally I would like to restrict my query to only a few types or prohibit certain types by query. Otherwise I would need to do this manually or find another service.
Just add the city name as a prefix in the search string. It will only give the search suggestions in which the user is searching.
eg, pass "NewYork" as a prefix in your search string, now type any word, it will only give you results for NewYork city restaurant, cafes, places, etc
We have multiple people assigned to a single ticket but when using the assignedToID field, it just returns the first user?.. Why is it not returning an array of user ids?
I know this is off-topic but is it possible to get user's name also and not just id?
To get a list of users you can user assignmentsListString
to pull user names instead of IDs you should be able to use
assignedTo:name
example
/attask/api/v4.0/task/54d25b43005a2117e6c2d674b932a666?fields=assignmentsListString,assignedTo:name
I've got a different result when requesting the Deezer search API for an album from my production server:
for instance this search: http://api.deezer.com/search/album?q=Billy%20Ze%20kick%20et%20Les%20Gamins%20en%20Folie%20Billy%20Ze%20Kick%20et%20Les%20Gamins%20en%20Folie
-on my laptop in France, I've got 2 results and the album #215350 as first result
-on an heroku europe instance I've got 2 results, and the album #41910 as first result (absolutely no result if the heroku instance is in the US...)
-and on my production (digital ocean in Amsterdam) server I've got the album #41910 as one and only result.
I'm assuming there is a legal issue related on which country this album is available but is there any way to avoid this?
others similars APIs have a local attribute which allow me to see if the album is available in the country of my end user...
this is a real issue my server is in Amsterdam... my users are everywhere...
Any idea or solution?
Thanks!
Search results are localized based on the current user's country (IP based). You can override the country by passing a user token to the request to make sure you always get the same results.
About availability, it is track-based: if you want to know if the song is available in a country, you'll have to query each track from your album. For example, http://api.deezer.com/track/2150054 returns the list of available countries.