Skip to Content
Menu
This question has been flagged
1 Reply
7469 Views

Hi,

I have a set of coordinates (latitude,longitude), I want to create a button which will open a google map with my given coordinates. Let say I have named the fields as latitude and longitude. What should be the function to open the google map in new tab with the coordinates in the given fields.

Avatar
Discard
Best Answer

You might find this free module useful, it already links Partners (Customers, Vendors) to a map with a button:

https://www.odoo.com/apps/modules/12.0/web_google_maps/

This module brings four new features:

  • New view map allows user to view all partners addresses on google maps.
  • New widget gplaces_address_autocomplete, enabled Google places autocomplete address form into partner form view,
    provide autocomplete feature when you typing an address of partner (or any field using this widget)
  • New widget gplaces_autocomplete, enabled Google places autocomplete into partner form view,
    provide autocomplete feature when typing partner name (or any field using this widget)
  • Map Localization

Avatar
Discard
Author

Well Thanks for the reply. But I was looking for some code which can help. Actually I have some data pushed by the mobile app in the database, which create records and contains the coordinates. So for validating the records the user will click on the said button and view the place given the record. It not to be used in customer. I have a separate model and a separate function to entertain

The module contains code you can leverage and move to your own separate model and your own function.

Author

ok Thnx. Let me read the code.

Related Posts Replies Views Activity
0
Mar 21
5193
3
Jul 20
18524
2
Jan 19
5092
1
Dec 18
1833
1
Jul 18
6087