Posts

Show path between two Address on google map in Odoo (ERP)

Image
  To show path, distance and duration between source and destination address on google map , just use this simple function in Odoo. An new window will pop up in browser, showing path between source address and destination address . def show_path_on_google_map(self):     ''’ Function to show path between Source and Destination Address on Google map '''     url="http://maps.google.com/maps?saddr="     # Demo Addresses     source_address = '   Mumbai, Maharashtra '     destination_address = 'Red Fort Delhi, India ,110006'             url += source_address + '&daddr=' + destination_address     return {         'type': 'ir.actions.act_url',         'url':url,         'nodestroy': True,         'target': 'new'     } Thanks Sonu ...

How to get Latitude and Longitude of address in Odoo ERP using Google Api in Python

In this blog we will see how we can  latitude and longitude of an address. You may require to get l atitude and longitude  between of an address in Odoo for many reasons . Here are steps to follow -   1.   First install pygeocoder Python Package:                Simply you can install using –                apt-get install python-pip                pip install pygeocoder or     or  you can download from python packages site Geocoder .   2.   Now import Geocoder class from pygeocoder in your py file          from pygeocoder import Geocoder          import urllib              import json             3.  Now you use  get_latitude_longitude function given below.     ...