Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 137 additions & 0 deletions base_google_map/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=======================
Google Maps Integration
=======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3a90b6ac518fa46ef3271a760ccddab02366aa4134b0e9ba66fa444925c9c49b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fgeospatial-lightgray.png?logo=github
:target: https://github.com/OCA/geospatial/tree/19.0/base_google_map
:alt: OCA/geospatial
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/geospatial-19-0/geospatial-19-0-base_google_map
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/geospatial&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows you to setup Google Maps configuration for map views
and related widgets.

**Table of contents**

.. contents::
:local:

Configuration
=============

This module installs ``base_setup`` and ``base_geolocalize``.

After installation, configure the Google Maps API key under **Settings >
General Settings > Google Maps View**.

With demo data enabled, the module sets a placeholder value
``YOUR_GOOGLE_MAPS_API_KEY`` on the ``google.api_key_geocode`` system
parameter. Replace it with a real key from your Google Cloud project
before using maps in a demo database.

Google APIs and services required for all features:

- Geocoding API
- Maps JavaScript API
- Places API

See the `Google
documentation <https://developers.google.com/maps/documentation/javascript/get-api-key>`__
on how to get an API key.

Usage
=====

1. Go to **Settings > General Settings**.
2. Open the **Google Maps View** section.
3. Set the API key, theme, language and region.
4. Enable the Geometry and Places libraries as needed.
5. Optionally enable related Google Maps view or widget modules.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/geospatial/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/geospatial/issues/new?body=module:%20base_google_map%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Gray Matter Logic

Contributors
------------

- Yopi Angi yopiangi@gmail.com
- `Gray Matter Logic <https://www.graymatterlogic.com>`__:

- Wolfgang Hall whall@opensourceintegrators.com
- Daniel Reis dreis@opensourceintegrators.com
- Ammar Officewala aofficewala@opensourceintegrators.com
- Maxime Chambreuil maxime.chambreuil@graymatterlogic.com

- Serpent Consulting Services Pvt. Ltd. support@serpentcs.com

Other credits
-------------

Module icon by Odoo S.A., LGPL 3.0

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-gityopie| image:: https://github.com/gityopie.png?size=40px
:target: https://github.com/gityopie
:alt: gityopie
.. |maintainer-wolfhall| image:: https://github.com/wolfhall.png?size=40px
:target: https://github.com/wolfhall
:alt: wolfhall

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-gityopie| |maintainer-wolfhall|

This module is part of the `OCA/geospatial <https://github.com/OCA/geospatial/tree/19.0/base_google_map>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions base_google_map/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import controllers
from . import models
19 changes: 19 additions & 0 deletions base_google_map/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Google Maps Integration",
"summary": "View modes and widgets to integrate Google Maps in your UI",
"version": "19.0.1.0.0",
"author": "Gray Matter Logic, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/geospatial",
"license": "AGPL-3",
"category": "Extra Tools",
"depends": ["base_setup", "base_geolocalize"],
"data": ["data/google_maps_libraries.xml", "views/res_config_settings.xml"],
"demo": ["demo/base_google_map_ir_config_parameter.xml"],
"images": ["static/description/thumbnails.png"],
"installable": True,
"application": True,
"maintainers": ["gityopie", "wolfhall"],
}
4 changes: 4 additions & 0 deletions base_google_map/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import main
25 changes: 25 additions & 0 deletions base_google_map/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import http
from odoo.tools.safe_eval import safe_eval


class Main(http.Controller):
@http.route("/web/map_theme", type="jsonrpc", auth="user")
def map_theme(self):
icp = http.request.env["ir.config_parameter"].sudo()
theme = icp.get_param("google.maps_theme", default="default")
return {"theme": theme}

@http.route("/web/google_autocomplete_conf", type="jsonrpc", auth="user")
def google_autocomplete_settings(self):
get_param = http.request.env["ir.config_parameter"].sudo().get_param
is_lang_restrict = safe_eval(
get_param("web_google_maps.autocomplete_lang_restrict", default="False")
)
lang = get_param("web_google_maps.lang_localization", default=False)
result = {}
if is_lang_restrict and lang:
result["language"] = lang
return result
8 changes: 8 additions & 0 deletions base_google_map/data/google_maps_libraries.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo noupdate="1">
<function
model="ir.config_parameter"
name="set_param"
eval="('google.maps_libraries', 'geometry,places')"
/>
</odoo>
12 changes: 12 additions & 0 deletions base_google_map/demo/base_google_map_ir_config_parameter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<!--
Placeholder only — replace with a real key from Google Cloud Console.
Required APIs: Geocoding API, Maps JavaScript API, Places API.
-->
<function
model="ir.config_parameter"
name="set_param"
eval="('google.api_key_geocode', 'YOUR_GOOGLE_MAPS_API_KEY')"
/>
</odoo>
Loading
Loading