跳至内容
菜单
此问题已终结
1 回复
8723 查看

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.

形象
丢弃
最佳答案

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

形象
丢弃
编写者

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.

编写者

ok Thnx. Let me read the code.

相关帖文 回复 查看 活动
0
3月 21
6658
3
7月 20
21014
2
1月 19
7166
1
12月 18
3053
1
7月 18
7448