Search for contacts by location
Return a list of contacts by distance to a location.
Views results on Bing or Google Maps.
Contact BlueStingray at firstname.lastname@example.org
CRM Geolocation using Bing Maps
The module is installed through Odoo's App interface. It will automatically install Odoo dependencies not already installed.
Getting an API key from Bing
After installing the module, you must obtain an API key from Microsoft or Google to use their Maps API. Microsoft's Getting Started Guide <https://msdn.microsoft.com/en-us/library/ff428643.aspx> or Google Maps API <https://developers.google.com/maps/> tells how to do this. Take note, any costs incurred using the Bing or Google API is between you and Microsoft/Google. Make sure you obtain the right level of service that suits your needs. Once you have this key, you must create a system parameter in Odoo identifying the key. After activating the developer mode, go to Settings -> Technical -> System Parameters. Create an entry named geolocation.bing_maps or geolocation.google_maps with a value of your key.
Getting the location of a contact
Once installed, two new fields are added to a Contact, Geo Latitude and Geo Longitude. These fields are viewable on the Contact form.
Doing a basic search
There is now a menu item for a Proximity Search, which is found on the Contacts menubar. Simply enter the zip code and distance (in miles) for your search.
The results are returned as a simple list.
Filtering the results
Once you have generated this list, it can be filtered just as you would any other list of contacts. So for example, you can filter by Vendor.
Viewing the results on a map
Finally, you can view the results on an interactive map. To do so, click on the map view icon near the top right of the list.
The result is your search location (the blue dot) along with the results (the purple dots) on an interactice map.
My contact location is showing as 0, 0
If you find that some of your searches are showing contacts that do not belong, you may have contacts without correct location data. Look at the problem contact and see if the Geo Latitude and Geo Longitude are 0.0. If so, the contact will show a warning. For example:
If so, there are two possibilities for why the contact does not have location information.
- If the contact existed before installed the CRM Geolocation module, then it will not get location information until there is an update in the contact's address. If you wish to do all contacts, then you can export all your data and reimport after making a small change to the address using Odoo's import export mechanisms. Doing something as simple as adding a space to the end of the address will work. Note that this could generate many hits against your Bing Maps account.
- If updating your contact's information still generates no location information, check your logs. The module generates entries with "GEOLOCATION ERROR" in the log. Search for that phrase to find the errors. The urllib error is listed. For example, if the key entered as a system parameter is incorrect, then a 401 Unauthorized error is generated.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.