summaryrefslogtreecommitdiff
path: root/addons/website_customer/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_customer/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_customer/controllers')
-rw-r--r--addons/website_customer/controllers/main.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/website_customer/controllers/main.py b/addons/website_customer/controllers/main.py
index 613f1969573..cba2b1cfbc6 100644
--- a/addons/website_customer/controllers/main.py
+++ b/addons/website_customer/controllers/main.py
@@ -79,6 +79,7 @@ class WebsiteCustomer(http.Controller):
partners = Partner.sudo().search(domain, offset=pager['offset'], limit=self._references_per_page)
google_map_partner_ids = ','.join(map(str, partners.ids))
+ google_maps_api_key = request.env['ir.config_parameter'].sudo().get_param('google_maps_api_key')
tags = Tag.search([('website_published', '=', True), ('partner_ids', 'in', partners.ids)], order='classname, name ASC')
tag = tag_id and Tag.browse(tag_id) or False
@@ -94,6 +95,7 @@ class WebsiteCustomer(http.Controller):
'search_path': "?%s" % werkzeug.url_encode(post),
'tag': tag,
'tags': tags,
+ 'google_maps_api_key': google_maps_api_key,
}
return request.render("website_customer.index", values)