diff --git a/test-requirements.txt b/test-requirements.txt index 66bc2cbae..9cbd08702 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1 +1,2 @@ odoo_test_helper +odoo-addon-web_view_leaflet_map @ git+https://github.com/OCA/geospatial.git@refs/pull/419/head#subdirectory=web_view_leaflet_map diff --git a/web_view_leaflet_map_partner/README.rst b/web_view_leaflet_map_partner/README.rst new file mode 100644 index 000000000..4e93604dd --- /dev/null +++ b/web_view_leaflet_map_partner/README.rst @@ -0,0 +1,112 @@ +============================================= +Leaflet Map View for Partners (OpenStreetMap) +============================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:00e98df5eb86b79a30fb40ad794dbc2b262cedd732be58efb324897039d347aa + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/licence-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/18.0/web_view_leaflet_map_partner + :alt: OCA/geospatial +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/geospatial-18-0/geospatial-18-0-web_view_leaflet_map_partner + :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=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the ``web_view_leaflet_map`` odoo module, to add a +map view on the res.partner model. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +You should configure first the module ``web_view_leaflet_map`` to enable +the feature. + +Usage +===== + +- go to 'Contact'. +- a new map icon is available. + +|image1| + +- by clicking on it, the partners are displayed on the map, if the + latitude and longitude are defined. (see ``base_geolocalize`` module) + +|image2| + +.. |image1| image:: https://raw.githubusercontent.com/OCA/geospatial/18.0/web_view_leaflet_map_partner/static/description/res_partner_button.png +.. |image2| image:: https://raw.githubusercontent.com/OCA/geospatial/18.0/web_view_leaflet_map_partner/static/description/view_res_partner_map.png + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* GRAP + +Contributors +------------ + +- Sylvain LE GAL (https://www.twitter.com/legalsylvain) + +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-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px + :target: https://github.com/legalsylvain + :alt: legalsylvain + +Current `maintainer `__: + +|maintainer-legalsylvain| + +This module is part of the `OCA/geospatial `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_view_leaflet_map_partner/__init__.py b/web_view_leaflet_map_partner/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/web_view_leaflet_map_partner/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/web_view_leaflet_map_partner/__manifest__.py b/web_view_leaflet_map_partner/__manifest__.py new file mode 100644 index 000000000..ef2f7d85b --- /dev/null +++ b/web_view_leaflet_map_partner/__manifest__.py @@ -0,0 +1,24 @@ +{ + "name": "Leaflet Map View for Partners (OpenStreetMap)", + "summary": "TODO", + "version": "18.0.1.0.0", + "development_status": "Alpha", + "author": "GRAP, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/geospatial", + "license": "AGPL-3", + "category": "Extra Tools", + "depends": [ + "web_view_leaflet_map", + "contacts", + ], + "data": [ + "views/res_partner.xml", + ], + "demo": [ + "demo/res_partner.xml", + ], + "installable": True, + "maintainers": [ + "legalsylvain", + ], +} diff --git a/web_view_leaflet_map_partner/demo/res_partner.xml b/web_view_leaflet_map_partner/demo/res_partner.xml new file mode 100644 index 000000000..c2f4af1a0 --- /dev/null +++ b/web_view_leaflet_map_partner/demo/res_partner.xml @@ -0,0 +1,71 @@ + + + + + + 35.82723 + -90.69499 + + + + + 38.64289 + -79.33115 + + + + + 27.94776 + -82.45844 + + + + + 35.60095 + -82.55402 + + + + + 34.090480 + -80.876894 + + + + + 32.60986 + -85.48078 + + + + + 34.1480092 + -114.1726054 + + + + + 41.40869 + -75.66213 + + diff --git a/web_view_leaflet_map_partner/i18n/it.po b/web_view_leaflet_map_partner/i18n/it.po new file mode 100644 index 000000000..dd7a41723 --- /dev/null +++ b/web_view_leaflet_map_partner/i18n/it.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_view_leaflet_map_partner +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-01-26 08:36+0000\n" +"Last-Translator: mymage \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 4.17\n" + +#. module: web_view_leaflet_map_partner +#: model:ir.model,name:web_view_leaflet_map_partner.model_res_partner +msgid "Contact" +msgstr "Contatto" + +#. module: web_view_leaflet_map_partner +#: model:ir.model.fields,field_description:web_view_leaflet_map_partner.field_res_partner__display_address +#: model:ir.model.fields,field_description:web_view_leaflet_map_partner.field_res_users__display_address +msgid "Display Address" +msgstr "Visualizza indirizzo" diff --git a/web_view_leaflet_map_partner/i18n/web_view_leaflet_map_partner.pot b/web_view_leaflet_map_partner/i18n/web_view_leaflet_map_partner.pot new file mode 100644 index 000000000..942c983dc --- /dev/null +++ b/web_view_leaflet_map_partner/i18n/web_view_leaflet_map_partner.pot @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_view_leaflet_map_partner +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_view_leaflet_map_partner +#: model:ir.model,name:web_view_leaflet_map_partner.model_res_partner +msgid "Contact" +msgstr "" + +#. module: web_view_leaflet_map_partner +#: model:ir.model.fields,field_description:web_view_leaflet_map_partner.field_res_partner__display_address +#: model:ir.model.fields,field_description:web_view_leaflet_map_partner.field_res_users__display_address +msgid "Display Address" +msgstr "" diff --git a/web_view_leaflet_map_partner/models/__init__.py b/web_view_leaflet_map_partner/models/__init__.py new file mode 100644 index 000000000..91fed54d4 --- /dev/null +++ b/web_view_leaflet_map_partner/models/__init__.py @@ -0,0 +1 @@ +from . import res_partner diff --git a/web_view_leaflet_map_partner/models/res_partner.py b/web_view_leaflet_map_partner/models/res_partner.py new file mode 100644 index 000000000..c296e6015 --- /dev/null +++ b/web_view_leaflet_map_partner/models/res_partner.py @@ -0,0 +1,13 @@ +# Copyright (C) 2019, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + display_address = fields.Char(compute="_compute_display_address") + + def _compute_display_address(self): + for partner in self: + partner.display_address = partner._display_address(without_company=True) diff --git a/web_view_leaflet_map_partner/pyproject.toml b/web_view_leaflet_map_partner/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/web_view_leaflet_map_partner/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/web_view_leaflet_map_partner/readme/CONFIGURE.md b/web_view_leaflet_map_partner/readme/CONFIGURE.md new file mode 100644 index 000000000..9d9f36a7e --- /dev/null +++ b/web_view_leaflet_map_partner/readme/CONFIGURE.md @@ -0,0 +1,2 @@ +You should configure first the module `web_view_leaflet_map` to enable +the feature. diff --git a/web_view_leaflet_map_partner/readme/CONTRIBUTORS.md b/web_view_leaflet_map_partner/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..4a6b63400 --- /dev/null +++ b/web_view_leaflet_map_partner/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Sylvain LE GAL () diff --git a/web_view_leaflet_map_partner/readme/DESCRIPTION.md b/web_view_leaflet_map_partner/readme/DESCRIPTION.md new file mode 100644 index 000000000..de512b504 --- /dev/null +++ b/web_view_leaflet_map_partner/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module extends the `web_view_leaflet_map` odoo module, to add a map +view on the res.partner model. diff --git a/web_view_leaflet_map_partner/readme/USAGE.md b/web_view_leaflet_map_partner/readme/USAGE.md new file mode 100644 index 000000000..81563efa6 --- /dev/null +++ b/web_view_leaflet_map_partner/readme/USAGE.md @@ -0,0 +1,9 @@ +- go to 'Contact'. +- a new map icon is available. + +![](../static/description/res_partner_button.png) + +- by clicking on it, the partners are displayed on the map, if the + latitude and longitude are defined. (see `base_geolocalize` module) + +![](../static/description/view_res_partner_map.png) diff --git a/web_view_leaflet_map_partner/static/description/icon.png b/web_view_leaflet_map_partner/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/web_view_leaflet_map_partner/static/description/icon.png differ diff --git a/web_view_leaflet_map_partner/static/description/index.html b/web_view_leaflet_map_partner/static/description/index.html new file mode 100644 index 000000000..5d7c8c53d --- /dev/null +++ b/web_view_leaflet_map_partner/static/description/index.html @@ -0,0 +1,452 @@ + + + + + +Leaflet Map View for Partners (OpenStreetMap) + + + +
+

Leaflet Map View for Partners (OpenStreetMap)

+ + +

Alpha License: AGPL-3 OCA/geospatial Translate me on Weblate Try me on Runboat

+

This module extends the web_view_leaflet_map odoo module, to add a +map view on the res.partner model.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Configuration

+

You should configure first the module web_view_leaflet_map to enable +the feature.

+
+
+

Usage

+
    +
  • go to ‘Contact’.
  • +
  • a new map icon is available.
  • +
+

image1

+
    +
  • by clicking on it, the partners are displayed on the map, if the +latitude and longitude are defined. (see base_geolocalize module)
  • +
+

image2

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • GRAP
  • +
+
+ +
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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.

+

Current maintainer:

+

legalsylvain

+

This module is part of the OCA/geospatial project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/web_view_leaflet_map_partner/static/description/res_partner_button.png b/web_view_leaflet_map_partner/static/description/res_partner_button.png new file mode 100644 index 000000000..b1b0be6ad Binary files /dev/null and b/web_view_leaflet_map_partner/static/description/res_partner_button.png differ diff --git a/web_view_leaflet_map_partner/static/description/res_partner_map.png b/web_view_leaflet_map_partner/static/description/res_partner_map.png new file mode 100644 index 000000000..a47b2cf52 Binary files /dev/null and b/web_view_leaflet_map_partner/static/description/res_partner_map.png differ diff --git a/web_view_leaflet_map_partner/views/res_partner.xml b/web_view_leaflet_map_partner/views/res_partner.xml new file mode 100644 index 000000000..b5f871303 --- /dev/null +++ b/web_view_leaflet_map_partner/views/res_partner.xml @@ -0,0 +1,26 @@ + + + + res.partner + + + + + + + kanban,list,form,activity,leaflet_map + + + + + leaflet_map + + + +