Skip to content
Closed
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
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -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
112 changes: 112 additions & 0 deletions web_view_leaflet_map_partner/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://odoo-community.org/page/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 <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_leaflet_map_partner%0Aversion:%2018.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
-------

* 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 <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-legalsylvain|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions web_view_leaflet_map_partner/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
24 changes: 24 additions & 0 deletions web_view_leaflet_map_partner/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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",
],
}
71 changes: 71 additions & 0 deletions web_view_leaflet_map_partner/demo/res_partner.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2022 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<record id="base.res_partner_12" model="res.partner">
<!-- Azure Interior
3404 Edgewood Road Jonesboro Arkansas, 72401
-->
<field name="partner_latitude">35.82723</field>
<field name="partner_longitude">-90.69499</field>
</record>

<record id="base.res_partner_2" model="res.partner">
<!-- Deco Addict
325 Elsie Drive Franklin West Virginia, 26807
-->
<field name="partner_latitude">38.64289</field>
<field name="partner_longitude">-79.33115</field>
</record>

<record id="base.res_partner_3" model="res.partner">
<!-- Gemini Furniture
1128 Lunetta Street Tampa Florida, 33634
-->
<field name="partner_latitude">27.94776</field>
<field name="partner_longitude">-82.45844</field>
</record>

<record id="base.res_partner_18" model="res.partner">
<!-- Lumber Inc
3202 Hannah Street Asheville North Carolina, 28801
-->
<field name="partner_latitude">35.60095</field>
<field name="partner_longitude">-82.55402</field>
</record>

<record id="base.res_partner_4" model="res.partner">
<!-- Ready Mat
92 Emily Drive Columbia Carolina, 29201
-->
<field name="partner_latitude">34.090480</field>
<field name="partner_longitude">-80.876894</field>
</record>

<record id="base.res_partner_10" model="res.partner">
<!-- The Jackson Group
823 Turkey Pen Lane Auburn Alabama,36830
-->
<field name="partner_latitude">32.60986</field>
<field name="partner_longitude">-85.48078</field>
</record>

<record id="base.res_partner_1" model="res.partner">
<!-- Wood Corner
1164 Cambridge Drive White Tanks Arizona, 85340
-->
<field name="partner_latitude">34.1480092</field>
<field name="partner_longitude">-114.1726054</field>
</record>

<record id="base.main_partner" model="res.partner">
<!-- Your company
1725 Slough Ave. Scranton Pennsylvania, 18540
-->
<field name="partner_latitude">41.40869</field>
<field name="partner_longitude">-75.66213</field>
</record>
</odoo>
28 changes: 28 additions & 0 deletions web_view_leaflet_map_partner/i18n/it.po
Original file line number Diff line number Diff line change
@@ -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 <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 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"
25 changes: 25 additions & 0 deletions web_view_leaflet_map_partner/i18n/web_view_leaflet_map_partner.pot
Original file line number Diff line number Diff line change
@@ -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 ""
1 change: 1 addition & 0 deletions web_view_leaflet_map_partner/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import res_partner
13 changes: 13 additions & 0 deletions web_view_leaflet_map_partner/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 3 additions & 0 deletions web_view_leaflet_map_partner/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions web_view_leaflet_map_partner/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
You should configure first the module `web_view_leaflet_map` to enable
the feature.
1 change: 1 addition & 0 deletions web_view_leaflet_map_partner/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Sylvain LE GAL (<https://www.twitter.com/legalsylvain>)
2 changes: 2 additions & 0 deletions web_view_leaflet_map_partner/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module extends the `web_view_leaflet_map` odoo module, to add a map
view on the res.partner model.
9 changes: 9 additions & 0 deletions web_view_leaflet_map_partner/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -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)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading