[IMP] website_google_map: display correct partner location on map

Currently, when the geolocation coordinates (latitude & longitude) of
the partner are not set, location for such partners is shown in the
middle of the sea (on /partners page).

With this commit, the coordinates are handled properly so that if they
are not set, instead of sending "0.0" to the map API, we now pass them
as a Falsy value, so that Geocoder API could use the available address
and locate such partners properly in the google map.

taskID-2819772

closes odoo/odoo#88622

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Pratik Raval
2022-06-08 14:40:24 +02:00
committed by Dharmraj Jhala
parent b74febe128
commit 1ba3cb040f
@@ -41,8 +41,8 @@ class GoogleMap(http.Controller):
'id': partner.id,
'name': partner.name,
'address': '\n'.join(partner.name_get()[0][1].split('\n')[1:]),
'latitude': str(partner.partner_latitude),
'longitude': str(partner.partner_longitude),
'latitude': str(partner.partner_latitude) if partner.partner_latitude else False,
'longitude': str(partner.partner_longitude) if partner.partner_longitude else False,
})
if 'customers' in post.get('partner_url', ''):
partner_url = '/customers/'