Skip to Content
Menu
This question has been flagged
1 Odpoveď
8615 Zobrazenia

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
Zrušiť
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
Zrušiť
Autor

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.

Autor

ok Thnx. Let me read the code.

Related Posts Replies Zobrazenia Aktivita
0
mar 21
6518
3
júl 20
20794
2
jan 19
6822
1
dec 18
2888
1
júl 18
7287