Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
8733 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore

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.

Autore

ok Thnx. Let me read the code.

Post correlati Risposte Visualizzazioni Attività
0
mar 21
6663
3
lug 20
21028
2
gen 19
7172
1
dic 18
3058
1
lug 18
7451