summaryrefslogtreecommitdiff
path: root/addons/website_google_map/controllers
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2016-08-25 14:04:32 +0200
committerNicolas Martinelli <nim@odoo.com>2016-08-25 16:33:23 +0200
commitc82b65c8552a2ddccb9ac9990366c03199ff9d29 (patch)
treef46e2f342b4fcabe0321221c500efa557ab85811 /addons/website_google_map/controllers
parent251344903d1ddee1672c4030b87349cd29fdc934 (diff)
[IMP] website, website_{*}: Google Maps API Key
As of June 22 2016, the use of API key is required to access the following: - Google Maps JavaScript API - Google Static Maps API - Google Street View Image API https://developers.google.com/maps/pricing-and-plans/standard-plan-2016-update For domains accessing the API before June 22, it will still work without an API key. Since Google advises to use the API key, we hide the Maps if no API key is defined.
Diffstat (limited to 'addons/website_google_map/controllers')
-rw-r--r--addons/website_google_map/controllers/main.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/website_google_map/controllers/main.py b/addons/website_google_map/controllers/main.py
index f20f2d1817b..0781ddf3da1 100644
--- a/addons/website_google_map/controllers/main.py
+++ b/addons/website_google_map/controllers/main.py
@@ -52,8 +52,10 @@ class GoogleMap(http.Controller):
else:
partner_url = '/partners/'
+ google_maps_api_key = request.env['ir.config_parameter'].sudo().get_param('google_maps_api_key')
values = {
'partner_url': partner_url,
- 'partner_data': json.dumps(partner_data)
+ 'partner_data': json.dumps(partner_data),
+ 'google_maps_api_key': google_maps_api_key,
}
return request.render("website_google_map.google_map", values)