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
165 changes: 165 additions & 0 deletions web_view_google_map/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

===============
Google Map View
===============

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

.. |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/web_view_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-web_view_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 adds a Google Maps view type and Places autocomplete field
widgets to the Odoo web client.

Features:

- ``google_map`` view mode to display geolocated records on Google Maps
- Marker colors from view attributes (``color`` / ``colors``)
- Marker clustering
- Field widgets ``gplaces_autocomplete`` and ``gplaces_address_form``

**Table of contents**

.. contents::
:local:

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

1. Install **Google Maps Integration** (``base_google_map``).
2. Go to *Settings → Google Maps Integration*.
3. Set your Google Maps API key and enable the **Places** / **Geometry**
libraries as needed.
4. Restrict the key in Google Cloud Console to your Odoo origins and the
Maps JavaScript API / Places API.

Usage
=====

Google Map view
---------------

Add a ``google_map`` view on any model that stores latitude/longitude:

.. code:: xml

<record id="view_partner_google_map" model="ir.ui.view">
<field name="name">res.partner.google_map</field>
<field name="model">res.partner</field>
<field name="arch" type="xml">
<google_map
string="Map"
lat="partner_latitude"
lng="partner_longitude"
colors="blue:company_type=='person';green:company_type=='company';"
>
<field name="partner_latitude" />
<field name="partner_longitude" />
<field name="display_name" />
<field name="company_type" />
</google_map>
</field>
</record>

Include ``google_map`` in the action ``view_mode``, for example
``list,form,google_map``.

Contacts already expose a Google Map mode on the partner action.

Places widgets
--------------

.. code:: xml

<field
name="street"
widget="gplaces_address_form"
options="{'lat': 'partner_latitude', 'lng': 'partner_longitude'}"
/>
<field
name="name"
widget="gplaces_autocomplete"
options="{'lat': 'partner_latitude', 'lng': 'partner_longitude'}"
/>

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:%20web_view_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
-------

* Open Source Integrators
* Gray Matter Logic

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

- Yopi Angi <yopiangi@gmail.com>
- Wolfgang Hall <whall@opensourceintegrators.com>
- Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
- Ammar Officewala <aofficewala@opensourceintegrators.com>
- `Gray Matter Logic <https://www.graymatterlogic.com>`__:

- Maxime Chambreuil <maxime.chambreuil@graymatterlogic.com>

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/web_view_google_map>`_ project on GitHub.

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

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

{
"name": "Google Map View",
"summary": "Add a Google Map view type to the Odoo web client",
"version": "19.0.1.0.0",
"author": "Open Source Integrators, Gray Matter Logic, "
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/geospatial",
"license": "AGPL-3",
"category": "Extra Tools",
"depends": ["base_google_map", "contacts"],
"data": ["views/res_partner.xml"],
"images": ["static/description/thumbnails.png"],
"assets": {
"web.assets_backend": [
"web_view_google_map/static/lib/markerclusterer/markerclusterer.min.js",
"web_view_google_map/static/src/views/google_map/map_themes.esm.js",
"web_view_google_map/static/src/views/google_map/google_maps_loader.esm.js",
"web_view_google_map/static/src/views/google_map/google_map_renderer.scss",
"web_view_google_map/static/src/views/google_map/google_map_renderer.esm.js",
"web_view_google_map/static/src/views/google_map/google_map_renderer.xml",
"web_view_google_map/static/src/views/google_map/google_map_controller.esm.js",
"web_view_google_map/static/src/views/google_map/google_map_controller.xml",
"web_view_google_map/static/src/views/google_map/google_map_view.esm.js",
"web_view_google_map/static/src/fields/gplaces_autocomplete.esm.js",
"web_view_google_map/static/src/fields/gplaces_autocomplete.xml",
"web_view_google_map/static/src/fields/gplaces_address_form.esm.js",
"web_view_google_map/static/src/fields/gplaces_address_form.xml",
],
},
"installable": True,
"uninstall_hook": "uninstall_hook",
"maintainers": ["gityopie", "wolfhall"],
}
16 changes: 16 additions & 0 deletions web_view_google_map/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (C) 2019, Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


def uninstall_hook(env):
env.cr.execute(
"UPDATE ir_act_window "
"SET view_mode=replace(view_mode, ',google_map', '') "
"WHERE view_mode LIKE '%,google_map%'"
)
env.cr.execute(
"UPDATE ir_act_window "
"SET view_mode=replace(view_mode, 'google_map,', '') "
"WHERE view_mode LIKE '%google_map,%'"
)
env.cr.execute("DELETE FROM ir_act_window WHERE view_mode = 'google_map'")
93 changes: 93 additions & 0 deletions web_view_google_map/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_view_google_map
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 19.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-05-20 17:26+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.10.4\n"

#. module: web_view_google_map
#. openerp-web
#: code:addons/web_view_google_map/static/src/js/widgets/gplaces_autocomplete.js:0
#: code:addons/web_view_google_map/static/src/js/widgets/gplaces_autocomplete.js:0
#, python-format
msgid "<ul><li></li></ul>"
msgstr ""

#. module: web_view_google_map
#: model:ir.model,name:web_view_google_map.model_ir_actions_act_window_view
msgid "Action Window View"
msgstr ""

#. module: web_view_google_map
#: model:ir.model.fields,field_description:web_view_google_map.field_ir_actions_act_window_view__display_name
#: model:ir.model.fields,field_description:web_view_google_map.field_ir_ui_view__display_name
msgid "Display Name"
msgstr ""

#. module: web_view_google_map
#. openerp-web
#: code:addons/web_view_google_map/static/src/js/view/map/map_view.js:0
#: model_terms:ir.ui.view,arch_db:web_view_google_map.view_res_partner_google_map
#, python-format
msgid "Google Map"
msgstr ""

#. module: web_view_google_map
#: model:ir.model.fields.selection,name:web_view_google_map.selection__ir_actions_act_window_view__view_mode__google_map
#: model:ir.model.fields.selection,name:web_view_google_map.selection__ir_ui_view__type__google_map
msgid "Google Maps"
msgstr ""

#. module: web_view_google_map
#: model:ir.model.fields,field_description:web_view_google_map.field_ir_actions_act_window_view__id
#: model:ir.model.fields,field_description:web_view_google_map.field_ir_ui_view__id
msgid "ID"
msgstr "ID"

#. module: web_view_google_map
#: model:ir.model.fields,field_description:web_view_google_map.field_ir_actions_act_window_view____last_update
#: model:ir.model.fields,field_description:web_view_google_map.field_ir_ui_view____last_update
msgid "Last Modified on"
msgstr ""

#. module: web_view_google_map
#. openerp-web
#: code:addons/web_view_google_map/static/src/js/view/map/map_renderer.js:0
#, python-format
msgid "Styled Map"
msgstr ""

#. module: web_view_google_map
#. openerp-web
#: code:addons/web_view_google_map/static/src/js/widgets/gplaces_autocomplete.js:0
#: code:addons/web_view_google_map/static/src/js/widgets/gplaces_autocomplete.js:0
#, python-format
msgid "The following fields are invalid:"
msgstr ""

#. module: web_view_google_map
#: model:ir.model,name:web_view_google_map.model_ir_ui_view
msgid "View"
msgstr ""

#. module: web_view_google_map
#: model:ir.model.fields,field_description:web_view_google_map.field_ir_actions_act_window_view__view_mode
#: model:ir.model.fields,field_description:web_view_google_map.field_ir_ui_view__type
msgid "View Type"
msgstr ""

#. module: web_view_google_map
#: model_terms:ir.ui.view,arch_db:web_view_google_map.view_res_partner_google_map
msgid "at"
msgstr ""
Loading
Loading