odoo-addon-web-view-leaflet-map 16.0.2.0.0.3__py3-none-any.whl → 18.0.1.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. odoo/addons/web_view_leaflet_map/README.rst +79 -77
  2. odoo/addons/web_view_leaflet_map/__manifest__.py +4 -5
  3. odoo/addons/web_view_leaflet_map/hooks.py +4 -4
  4. odoo/addons/web_view_leaflet_map/i18n/web_view_leaflet_map.pot +1 -9
  5. odoo/addons/web_view_leaflet_map/models/ir_ui_view.py +3 -0
  6. odoo/addons/web_view_leaflet_map/readme/CONFIGURE.md +1 -0
  7. odoo/addons/web_view_leaflet_map/readme/CONTRIBUTORS.md +1 -0
  8. odoo/addons/web_view_leaflet_map/readme/DESCRIPTION.md +13 -0
  9. odoo/addons/web_view_leaflet_map/readme/DEVELOP.md +53 -0
  10. odoo/addons/web_view_leaflet_map/readme/ROADMAP.md +8 -0
  11. odoo/addons/web_view_leaflet_map/static/description/index.html +55 -56
  12. odoo/addons/web_view_leaflet_map/static/src/components/map-component/map_view.esm.js +331 -0
  13. odoo/addons/web_view_leaflet_map/static/src/components/map-component/map_view.xml +19 -0
  14. {odoo_addon_web_view_leaflet_map-16.0.2.0.0.3.dist-info → odoo_addon_web_view_leaflet_map-18.0.1.0.1.dist-info}/METADATA +86 -83
  15. odoo_addon_web_view_leaflet_map-18.0.1.0.1.dist-info/RECORD +26 -0
  16. {odoo_addon_web_view_leaflet_map-16.0.2.0.0.3.dist-info → odoo_addon_web_view_leaflet_map-18.0.1.0.1.dist-info}/WHEEL +1 -1
  17. odoo_addon_web_view_leaflet_map-18.0.1.0.1.dist-info/top_level.txt +1 -0
  18. odoo/addons/web_view_leaflet_map/readme/CONFIGURE.rst +0 -1
  19. odoo/addons/web_view_leaflet_map/readme/CONTRIBUTORS.rst +0 -1
  20. odoo/addons/web_view_leaflet_map/readme/DESCRIPTION.rst +0 -11
  21. odoo/addons/web_view_leaflet_map/readme/DEVELOP.rst +0 -62
  22. odoo/addons/web_view_leaflet_map/readme/ROADMAP.rst +0 -8
  23. odoo/addons/web_view_leaflet_map/static/src/js/view/map/map_renderer.js +0 -178
  24. odoo/addons/web_view_leaflet_map/static/src/js/view/map/map_view.js +0 -34
  25. odoo/addons/web_view_leaflet_map/static/src/js/view/view_registry.js +0 -8
  26. odoo_addon_web_view_leaflet_map-16.0.2.0.0.3.dist-info/RECORD +0 -27
  27. odoo_addon_web_view_leaflet_map-16.0.2.0.0.3.dist-info/top_level.txt +0 -1
  28. /odoo/addons/web_view_leaflet_map/static/src/{css → components/map-component}/web_view_leaflet_map.css +0 -0
@@ -1,3 +1,7 @@
1
+ .. image:: https://odoo-community.org/readme-banner-image
2
+ :target: https://odoo-community.org/get-involved?utm_source=readme
3
+ :alt: Odoo Community Association
4
+
1
5
  ================================
2
6
  Leaflet Map View (OpenStreetMap)
3
7
  ================================
@@ -7,38 +11,44 @@ Leaflet Map View (OpenStreetMap)
7
11
  !! This file is generated by oca-gen-addon-readme !!
8
12
  !! changes will be overwritten. !!
9
13
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
- !! source digest: sha256:f494ec35cbd29ae4bcc5e46a7a30bf5b2261bd449a3b0ba08a95a70d45dbea12
14
+ !! source digest: sha256:b819c0e0d0b447189a53096676a3ce5eb62eb32e5dbeed12d05c5ab3a187d5f5
11
15
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
16
 
13
17
  .. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
14
18
  :target: https://odoo-community.org/page/development-status
15
19
  :alt: Alpha
16
- .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
20
+ .. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
17
21
  :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18
22
  :alt: License: AGPL-3
19
23
  .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fgeospatial-lightgray.png?logo=github
20
- :target: https://github.com/OCA/geospatial/tree/16.0/web_view_leaflet_map
24
+ :target: https://github.com/OCA/geospatial/tree/18.0/web_view_leaflet_map
21
25
  :alt: OCA/geospatial
22
26
  .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23
- :target: https://translation.odoo-community.org/projects/geospatial-16-0/geospatial-16-0-web_view_leaflet_map
27
+ :target: https://translation.odoo-community.org/projects/geospatial-18-0/geospatial-18-0-web_view_leaflet_map
24
28
  :alt: Translate me on Weblate
25
29
  .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26
- :target: https://runboat.odoo-community.org/builds?repo=OCA/geospatial&target_branch=16.0
30
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/geospatial&target_branch=18.0
27
31
  :alt: Try me on Runboat
28
32
 
29
33
  |badge1| |badge2| |badge3| |badge4| |badge5|
30
34
 
31
- This module extends odoo views, to add a new kind of view, named ``leaflet_map``
32
- that is using the Leaflet javascript library to use maps. (https://leafletjs.com/)
33
- This library is for exemple, used in the OpenStreetMap project. (https://www.openstreetmap.org/)
35
+ This module extends odoo views, to add a new kind of view, named
36
+ ``leaflet_map`` that is using the Leaflet javascript library to use
37
+ maps. (https://leafletjs.com/) This library is for exemple, used in the
38
+ OpenStreetMap project. (https://www.openstreetmap.org/)
39
+
40
+ You can see a simple usage in the module
41
+ ``web_view_leaflet_map_partner`` in the same OCA repository that
42
+ displays your contact in a map, if latitude and longitude are defined.
43
+ (To define latitude and longitude, refer to the Odoo module
44
+ ``base_geolocalize``)
34
45
 
35
- You can see a simple usage in the module ``web_view_leaflet_map_partner`` in the
36
- same OCA repository that displays your contact in a map, if latitude and longitude are
37
- defined. (To define latitude and longitude, refer to the Odoo module ``base_geolocalize``)
46
+ |image1|
38
47
 
39
- .. figure:: https://raw.githubusercontent.com/OCA/geospatial/16.0/web_view_leaflet_map/static/description/view_res_partner_map_1.png
48
+ |image2|
40
49
 
41
- .. figure:: https://raw.githubusercontent.com/OCA/geospatial/16.0/web_view_leaflet_map/static/description/view_res_partner_map_2.png
50
+ .. |image1| image:: https://raw.githubusercontent.com/OCA/geospatial/18.0/web_view_leaflet_map/static/description/view_res_partner_map_1.png
51
+ .. |image2| image:: https://raw.githubusercontent.com/OCA/geospatial/18.0/web_view_leaflet_map/static/description/view_res_partner_map_2.png
42
52
 
43
53
  .. IMPORTANT::
44
54
  This is an alpha version, the data model and design can change at any time without warning.
@@ -53,85 +63,77 @@ defined. (To define latitude and longitude, refer to the Odoo module ``base_geol
53
63
  Configuration
54
64
  =============
55
65
 
56
- * See configuration of the module ``web_leaflet_lib``.
66
+ - See configuration of the module ``web_leaflet_lib``.
57
67
 
58
68
  Development
59
69
  ===========
60
70
 
61
71
  Create a new view :
62
72
 
63
- .. code-block:: xml
64
-
65
- <record id="view_my_model_map" model="ir.ui.view">
66
- <field name="model">my.model</field>
67
- <field name="arch" type="xml">
68
- <leaflet_map
69
- field_latitude="FIELD_LATITUDE"
70
- field_longitude="FIELD_LONGITUDE"
71
- field_title="FIELD_TITLE"
72
- field_address="FIELD_ADDRESS"
73
- field_marker_icon_image="FIELD_MARKER_ICON_IMAGE"
74
- >
75
- <field name="__last_update"/>
76
- <field name="FIELD_LATITUDE"/>
77
- <field name="FIELD_LONGITUDE"/>
78
- <field name="FIELD_TITLE"/>
79
- <field name="FIELD_ADDRESS"/>
80
- </leaflet_map>
81
- </field>
82
- </record>
83
-
84
- 1. FIELD_LATITUDE and FIELD_LONGITUDE are the name of the fields that contains GPS coordinates of the model.
73
+ .. code:: xml
74
+
75
+ <record id="view_my_model_map" model="ir.ui.view">
76
+ <field name="model">my.model</field>
77
+ <field name="arch" type="xml">
78
+ <leaflet_map
79
+ field_latitude="FIELD_LATITUDE"
80
+ field_longitude="FIELD_LONGITUDE"
81
+ field_title="FIELD_TITLE"
82
+ field_address="FIELD_ADDRESS"
83
+ field_marker_icon_image="FIELD_MARKER_ICON_IMAGE"
84
+ >
85
+ <field name="__last_update"/>
86
+ <field name="FIELD_LATITUDE"/>
87
+ <field name="FIELD_LONGITUDE"/>
88
+ <field name="FIELD_TITLE"/>
89
+ <field name="FIELD_ADDRESS"/>
90
+ </leaflet_map>
91
+ </field>
92
+ </record>
93
+
94
+ 1. FIELD_LATITUDE and FIELD_LONGITUDE are the name of the fields that
95
+ contains GPS coordinates of the model.
85
96
  2. FIELD_TITLE will be used when the popup is displayed, as a title.
86
- 3. FIELD_ADDRESS will be used when the popup is displayed to display the adress.
87
- 4. (optional) FIELD_MARKER_ICON_IMAGE, is the name of the image field to place as an icon
88
- of the marker.
89
- Note: You can set extra settings ``marker_icon_size_x``, ``marker_icon_size_y``, to define
90
- the size of the image, and ``marker_popup_anchor_x``, ``marker_popup_anchor_y`` to define
91
- the position of the popup.
97
+ 3. FIELD_ADDRESS will be used when the popup is displayed to display the
98
+ adress.
99
+ 4. (optional) FIELD_MARKER_ICON_IMAGE, is the name of the image field to
100
+ place as an icon of the marker. Note: You can set extra settings
101
+ ``marker_icon_size_x``, ``marker_icon_size_y``, to define the size of
102
+ the image, and ``marker_popup_anchor_x``, ``marker_popup_anchor_y``
103
+ to define the position of the popup.
92
104
 
93
105
  Map options :
94
106
 
95
107
  - ``default_zoom`` : define the default zoom value. (7 if not defined)
96
108
  - ``max_zoom`` : define the max zoom value. (19 if not defined)
97
- - ``zoom_snap`` : define the zoom level in each change. (1 if not defined)
98
-
99
- * Create or update an action for the model
100
-
101
- .. code-block:: xml
109
+ - ``zoom_snap`` : define the zoom level in each change. (1 if not
110
+ defined)
111
+ - Create or update an action for the model
102
112
 
103
- <record id="my_module.action_my_model" model="ir.actions.act_window">
104
- <field name="view_mode">tree,form,leaflet_map</field>
105
- </record>
113
+ .. code:: xml
106
114
 
107
- **Library Update**
108
-
109
- For the time being, the module embed the lealflet.js library version 1.8.0 ( released on April 18, 2022.)
110
-
111
- If a new release is out:
112
-
113
- - please download it here https://leafletjs.com/download.html
114
- - update the javascript, css and images, present in the folder ``static/lib/leaflet``
115
- - test the features
116
- - make a Pull Request
115
+ <record id="my_module.action_my_model" model="ir.actions.act_window">
116
+ <field name="view_mode">tree,form,leaflet_map</field>
117
+ </record>
117
118
 
118
119
  **Default position in the map**
119
120
 
120
- By default, the position of the map is defined by the user, in the function
121
- ``get_default_leaflet_position``. It returns the position of the current company, if defined.
122
- you can overload this function globally, or per model.
121
+ By default, the position of the map is defined by the user, in the
122
+ function ``get_default_leaflet_position``. It returns the position of
123
+ the current company, if defined. you can overload this function
124
+ globally, or per model.
123
125
 
124
126
  Known issues / Roadmap
125
127
  ======================
126
128
 
127
- * For the time being, at the start of the map loading, the call of ``invalidateSize()``
128
- is required. We should investigate why and try to remove that call.
129
- see https://github.com/Leaflet/Leaflet/issues/3002#issuecomment-93836022
130
-
131
- * For the time being, the map has "Markers" and allow to display odoo items
132
- if longitude and latitude are available. We could imagine other kind of usages,
133
- with Polylines, Polygons, etc...
134
- See all the leaflet options : https://leafletjs.com/reference.html
129
+ - For the time being, at the start of the map loading, the call of
130
+ ``invalidateSize()`` is required. We should investigate why and try to
131
+ remove that call. see
132
+ https://github.com/Leaflet/Leaflet/issues/3002#issuecomment-93836022
133
+ - For the time being, the map has "Markers" and allow to display odoo
134
+ items if longitude and latitude are available. We could imagine other
135
+ kind of usages, with Polylines, Polygons, etc... See all the leaflet
136
+ options : https://leafletjs.com/reference.html
135
137
 
136
138
  Bug Tracker
137
139
  ===========
@@ -139,7 +141,7 @@ Bug Tracker
139
141
  Bugs are tracked on `GitHub Issues <https://github.com/OCA/geospatial/issues>`_.
140
142
  In case of trouble, please check there if your issue has already been reported.
141
143
  If you spotted it first, help us to smash it by providing a detailed and welcomed
142
- `feedback <https://github.com/OCA/geospatial/issues/new?body=module:%20web_view_leaflet_map%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
144
+ `feedback <https://github.com/OCA/geospatial/issues/new?body=module:%20web_view_leaflet_map%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
143
145
 
144
146
  Do not contact contributors directly about support or help with technical issues.
145
147
 
@@ -147,17 +149,17 @@ Credits
147
149
  =======
148
150
 
149
151
  Authors
150
- ~~~~~~~
152
+ -------
151
153
 
152
154
  * GRAP
153
155
 
154
156
  Contributors
155
- ~~~~~~~~~~~~
157
+ ------------
156
158
 
157
- * Sylvain LE GAL (https://www.twitter.com/legalsylvain)
159
+ - Sylvain LE GAL (https://www.twitter.com/legalsylvain)
158
160
 
159
161
  Maintainers
160
- ~~~~~~~~~~~
162
+ -----------
161
163
 
162
164
  This module is maintained by the OCA.
163
165
 
@@ -177,6 +179,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
177
179
 
178
180
  |maintainer-legalsylvain|
179
181
 
180
- This module is part of the `OCA/geospatial <https://github.com/OCA/geospatial/tree/16.0/web_view_leaflet_map>`_ project on GitHub.
182
+ This module is part of the `OCA/geospatial <https://github.com/OCA/geospatial/tree/18.0/web_view_leaflet_map>`_ project on GitHub.
181
183
 
182
184
  You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
@@ -5,7 +5,7 @@
5
5
  {
6
6
  "name": "Leaflet Map View (OpenStreetMap)",
7
7
  "summary": "Add new 'leaflet_map' view, to display markers.",
8
- "version": "16.0.2.0.0",
8
+ "version": "18.0.1.0.1",
9
9
  "development_status": "Alpha",
10
10
  "author": "GRAP, Odoo Community Association (OCA)",
11
11
  "maintainers": ["legalsylvain"],
@@ -18,10 +18,9 @@
18
18
  ],
19
19
  "assets": {
20
20
  "web.assets_backend": [
21
- "web_view_leaflet_map/static/src/js/view/view_registry.js",
22
- "web_view_leaflet_map/static/src/js/view/map/map_renderer.js",
23
- "web_view_leaflet_map/static/src/js/view/map/map_view.js",
24
- "web_view_leaflet_map/static/src/css/web_view_leaflet_map.css",
21
+ "web_view_leaflet_map/static/src/components/map-component/map_view.esm.js",
22
+ "web_view_leaflet_map/static/src/components/map-component/map_view.xml",
23
+ "web_view_leaflet_map/static/src/components/map-component/web_view_leaflet_map.css",
25
24
  ],
26
25
  },
27
26
  "installable": True,
@@ -4,15 +4,15 @@
4
4
  # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
5
5
 
6
6
 
7
- def uninstall_hook(cr, registry):
8
- cr.execute(
7
+ def uninstall_hook(env):
8
+ env.cr.execute(
9
9
  "UPDATE ir_act_window "
10
10
  "SET view_mode=replace(view_mode, ',leaflet_map', '')"
11
11
  "WHERE view_mode LIKE '%,leaflet_map%';"
12
12
  )
13
- cr.execute(
13
+ env.cr.execute(
14
14
  "UPDATE ir_act_window "
15
15
  "SET view_mode=replace(view_mode, 'leaflet_map,', '')"
16
16
  "WHERE view_mode LIKE '%leaflet_map,%';"
17
17
  )
18
- cr.execute("DELETE FROM ir_act_window " "WHERE view_mode = 'leaflet_map';")
18
+ env.cr.execute("DELETE FROM ir_act_window " "WHERE view_mode = 'leaflet_map';")
@@ -4,7 +4,7 @@
4
4
  #
5
5
  msgid ""
6
6
  msgstr ""
7
- "Project-Id-Version: Odoo Server 16.0\n"
7
+ "Project-Id-Version: Odoo Server 18.0\n"
8
8
  "Report-Msgid-Bugs-To: \n"
9
9
  "Last-Translator: \n"
10
10
  "Language-Team: \n"
@@ -24,13 +24,6 @@ msgstr ""
24
24
  msgid "Leaflet Map"
25
25
  msgstr ""
26
26
 
27
- #. module: web_view_leaflet_map
28
- #. odoo-javascript
29
- #: code:addons/web_view_leaflet_map/static/src/js/view/map/map_view.js:0
30
- #, python-format
31
- msgid "Map"
32
- msgstr ""
33
-
34
27
  #. module: web_view_leaflet_map
35
28
  #: model:ir.model,name:web_view_leaflet_map.model_res_users
36
29
  msgid "User"
@@ -44,6 +37,5 @@ msgstr ""
44
37
  #. module: web_view_leaflet_map
45
38
  #: model:ir.model.fields,field_description:web_view_leaflet_map.field_ir_actions_act_window_view__view_mode
46
39
  #: model:ir.model.fields,field_description:web_view_leaflet_map.field_ir_ui_view__type
47
- #: model:ir.model.fields,field_description:web_view_leaflet_map.field_website_page__type
48
40
  msgid "View Type"
49
41
  msgstr ""
@@ -10,3 +10,6 @@ class IrUiView(models.Model):
10
10
  _inherit = "ir.ui.view"
11
11
 
12
12
  type = fields.Selection(selection_add=[("leaflet_map", "Leaflet Map")])
13
+
14
+ def _get_view_info(self):
15
+ return {"leaflet_map": {"icon": "fa fa-map-o"}} | super()._get_view_info()
@@ -0,0 +1 @@
1
+ - See configuration of the module `web_leaflet_lib`.
@@ -0,0 +1 @@
1
+ - Sylvain LE GAL (<https://www.twitter.com/legalsylvain>)
@@ -0,0 +1,13 @@
1
+ This module extends odoo views, to add a new kind of view, named
2
+ `leaflet_map` that is using the Leaflet javascript library to use maps.
3
+ (<https://leafletjs.com/>) This library is for exemple, used in the
4
+ OpenStreetMap project. (<https://www.openstreetmap.org/>)
5
+
6
+ You can see a simple usage in the module `web_view_leaflet_map_partner`
7
+ in the same OCA repository that displays your contact in a map, if
8
+ latitude and longitude are defined. (To define latitude and longitude,
9
+ refer to the Odoo module `base_geolocalize`)
10
+
11
+ ![](../static/description/view_res_partner_map_1.png)
12
+
13
+ ![](../static/description/view_res_partner_map_2.png)
@@ -0,0 +1,53 @@
1
+ Create a new view :
2
+
3
+ ``` xml
4
+ <record id="view_my_model_map" model="ir.ui.view">
5
+ <field name="model">my.model</field>
6
+ <field name="arch" type="xml">
7
+ <leaflet_map
8
+ field_latitude="FIELD_LATITUDE"
9
+ field_longitude="FIELD_LONGITUDE"
10
+ field_title="FIELD_TITLE"
11
+ field_address="FIELD_ADDRESS"
12
+ field_marker_icon_image="FIELD_MARKER_ICON_IMAGE"
13
+ >
14
+ <field name="__last_update"/>
15
+ <field name="FIELD_LATITUDE"/>
16
+ <field name="FIELD_LONGITUDE"/>
17
+ <field name="FIELD_TITLE"/>
18
+ <field name="FIELD_ADDRESS"/>
19
+ </leaflet_map>
20
+ </field>
21
+ </record>
22
+ ```
23
+
24
+ 1. FIELD_LATITUDE and FIELD_LONGITUDE are the name of the fields that
25
+ contains GPS coordinates of the model.
26
+ 2. FIELD_TITLE will be used when the popup is displayed, as a title.
27
+ 3. FIELD_ADDRESS will be used when the popup is displayed to display
28
+ the adress.
29
+ 4. (optional) FIELD_MARKER_ICON_IMAGE, is the name of the image field
30
+ to place as an icon of the marker. Note: You can set extra settings
31
+ `marker_icon_size_x`, `marker_icon_size_y`, to define the size of
32
+ the image, and `marker_popup_anchor_x`, `marker_popup_anchor_y` to
33
+ define the position of the popup.
34
+
35
+ Map options :
36
+
37
+ - `default_zoom` : define the default zoom value. (7 if not defined)
38
+ - `max_zoom` : define the max zoom value. (19 if not defined)
39
+ - `zoom_snap` : define the zoom level in each change. (1 if not defined)
40
+ - Create or update an action for the model
41
+
42
+ ``` xml
43
+ <record id="my_module.action_my_model" model="ir.actions.act_window">
44
+ <field name="view_mode">tree,form,leaflet_map</field>
45
+ </record>
46
+ ```
47
+
48
+ **Default position in the map**
49
+
50
+ By default, the position of the map is defined by the user, in the
51
+ function `get_default_leaflet_position`. It returns the position of the
52
+ current company, if defined. you can overload this function globally, or
53
+ per model.
@@ -0,0 +1,8 @@
1
+ - For the time being, at the start of the map loading, the call of
2
+ `invalidateSize()` is required. We should investigate why and try to
3
+ remove that call. see
4
+ <https://github.com/Leaflet/Leaflet/issues/3002#issuecomment-93836022>
5
+ - For the time being, the map has "Markers" and allow to display odoo
6
+ items if longitude and latitude are available. We could imagine other
7
+ kind of usages, with Polylines, Polygons, etc... See all the leaflet
8
+ options : <https://leafletjs.com/reference.html>
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
5
  <meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6
- <title>Leaflet Map View (OpenStreetMap)</title>
6
+ <title>README.rst</title>
7
7
  <style type="text/css">
8
8
 
9
9
  /*
@@ -360,28 +360,32 @@ ul.auto-toc {
360
360
  </style>
361
361
  </head>
362
362
  <body>
363
- <div class="document" id="leaflet-map-view-openstreetmap">
364
- <h1 class="title">Leaflet Map View (OpenStreetMap)</h1>
363
+ <div class="document">
365
364
 
365
+
366
+ <a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367
+ <img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368
+ </a>
369
+ <div class="section" id="leaflet-map-view-openstreetmap">
370
+ <h1>Leaflet Map View (OpenStreetMap)</h1>
366
371
  <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367
372
  !! This file is generated by oca-gen-addon-readme !!
368
373
  !! changes will be overwritten. !!
369
374
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
- !! source digest: sha256:f494ec35cbd29ae4bcc5e46a7a30bf5b2261bd449a3b0ba08a95a70d45dbea12
375
+ !! source digest: sha256:b819c0e0d0b447189a53096676a3ce5eb62eb32e5dbeed12d05c5ab3a187d5f5
371
376
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372
- <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/geospatial/tree/16.0/web_view_leaflet_map"><img alt="OCA/geospatial" src="https://img.shields.io/badge/github-OCA%2Fgeospatial-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/geospatial-16-0/geospatial-16-0-web_view_leaflet_map"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/geospatial&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373
- <p>This module extends odoo views, to add a new kind of view, named <tt class="docutils literal">leaflet_map</tt>
374
- that is using the Leaflet javascript library to use maps. (<a class="reference external" href="https://leafletjs.com/">https://leafletjs.com/</a>)
375
- This library is for exemple, used in the OpenStreetMap project. (<a class="reference external" href="https://www.openstreetmap.org/">https://www.openstreetmap.org/</a>)</p>
376
- <p>You can see a simple usage in the module <tt class="docutils literal">web_view_leaflet_map_partner</tt> in the
377
- same OCA repository that displays your contact in a map, if latitude and longitude are
378
- defined. (To define latitude and longitude, refer to the Odoo module <tt class="docutils literal">base_geolocalize</tt>)</p>
379
- <div class="figure">
380
- <img alt="https://raw.githubusercontent.com/OCA/geospatial/16.0/web_view_leaflet_map/static/description/view_res_partner_map_1.png" src="https://raw.githubusercontent.com/OCA/geospatial/16.0/web_view_leaflet_map/static/description/view_res_partner_map_1.png" />
381
- </div>
382
- <div class="figure">
383
- <img alt="https://raw.githubusercontent.com/OCA/geospatial/16.0/web_view_leaflet_map/static/description/view_res_partner_map_2.png" src="https://raw.githubusercontent.com/OCA/geospatial/16.0/web_view_leaflet_map/static/description/view_res_partner_map_2.png" />
384
- </div>
377
+ <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/geospatial/tree/18.0/web_view_leaflet_map"><img alt="OCA/geospatial" src="https://img.shields.io/badge/github-OCA%2Fgeospatial-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/geospatial-18-0/geospatial-18-0-web_view_leaflet_map"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/geospatial&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378
+ <p>This module extends odoo views, to add a new kind of view, named
379
+ <tt class="docutils literal">leaflet_map</tt> that is using the Leaflet javascript library to use
380
+ maps. (<a class="reference external" href="https://leafletjs.com/">https://leafletjs.com/</a>) This library is for exemple, used in the
381
+ OpenStreetMap project. (<a class="reference external" href="https://www.openstreetmap.org/">https://www.openstreetmap.org/</a>)</p>
382
+ <p>You can see a simple usage in the module
383
+ <tt class="docutils literal">web_view_leaflet_map_partner</tt> in the same OCA repository that
384
+ displays your contact in a map, if latitude and longitude are defined.
385
+ (To define latitude and longitude, refer to the Odoo module
386
+ <tt class="docutils literal">base_geolocalize</tt>)</p>
387
+ <p><img alt="image1" src="https://raw.githubusercontent.com/OCA/geospatial/18.0/web_view_leaflet_map/static/description/view_res_partner_map_1.png" /></p>
388
+ <p><img alt="image2" src="https://raw.githubusercontent.com/OCA/geospatial/18.0/web_view_leaflet_map/static/description/view_res_partner_map_2.png" /></p>
385
389
  <div class="admonition important">
386
390
  <p class="first admonition-title">Important</p>
387
391
  <p class="last">This is an alpha version, the data model and design can change at any time without warning.
@@ -404,13 +408,13 @@ Only for development or testing purpose, do not use in production.
404
408
  </ul>
405
409
  </div>
406
410
  <div class="section" id="configuration">
407
- <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
411
+ <h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
408
412
  <ul class="simple">
409
413
  <li>See configuration of the module <tt class="docutils literal">web_leaflet_lib</tt>.</li>
410
414
  </ul>
411
415
  </div>
412
416
  <div class="section" id="development">
413
- <h1><a class="toc-backref" href="#toc-entry-2">Development</a></h1>
417
+ <h2><a class="toc-backref" href="#toc-entry-2">Development</a></h2>
414
418
  <p>Create a new view :</p>
415
419
  <pre class="code xml literal-block">
416
420
  <span class="nt">&lt;record</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;view_my_model_map&quot;</span><span class="w"> </span><span class="na">model=</span><span class="s">&quot;ir.ui.view&quot;</span><span class="nt">&gt;</span><span class="w">
@@ -433,22 +437,23 @@ Only for development or testing purpose, do not use in production.
433
437
  </span><span class="nt">&lt;/record&gt;</span>
434
438
  </pre>
435
439
  <ol class="arabic simple">
436
- <li>FIELD_LATITUDE and FIELD_LONGITUDE are the name of the fields that contains GPS coordinates of the model.</li>
440
+ <li>FIELD_LATITUDE and FIELD_LONGITUDE are the name of the fields that
441
+ contains GPS coordinates of the model.</li>
437
442
  <li>FIELD_TITLE will be used when the popup is displayed, as a title.</li>
438
- <li>FIELD_ADDRESS will be used when the popup is displayed to display the adress.</li>
439
- <li>(optional) FIELD_MARKER_ICON_IMAGE, is the name of the image field to place as an icon
440
- of the marker.
441
- Note: You can set extra settings <tt class="docutils literal">marker_icon_size_x</tt>, <tt class="docutils literal">marker_icon_size_y</tt>, to define
442
- the size of the image, and <tt class="docutils literal">marker_popup_anchor_x</tt>, <tt class="docutils literal">marker_popup_anchor_y</tt> to define
443
- the position of the popup.</li>
443
+ <li>FIELD_ADDRESS will be used when the popup is displayed to display the
444
+ adress.</li>
445
+ <li>(optional) FIELD_MARKER_ICON_IMAGE, is the name of the image field to
446
+ place as an icon of the marker. Note: You can set extra settings
447
+ <tt class="docutils literal">marker_icon_size_x</tt>, <tt class="docutils literal">marker_icon_size_y</tt>, to define the size of
448
+ the image, and <tt class="docutils literal">marker_popup_anchor_x</tt>, <tt class="docutils literal">marker_popup_anchor_y</tt>
449
+ to define the position of the popup.</li>
444
450
  </ol>
445
451
  <p>Map options :</p>
446
452
  <ul class="simple">
447
453
  <li><tt class="docutils literal">default_zoom</tt> : define the default zoom value. (7 if not defined)</li>
448
454
  <li><tt class="docutils literal">max_zoom</tt> : define the max zoom value. (19 if not defined)</li>
449
- <li><tt class="docutils literal">zoom_snap</tt> : define the zoom level in each change. (1 if not defined)</li>
450
- </ul>
451
- <ul class="simple">
455
+ <li><tt class="docutils literal">zoom_snap</tt> : define the zoom level in each change. (1 if not
456
+ defined)</li>
452
457
  <li>Create or update an action for the model</li>
453
458
  </ul>
454
459
  <pre class="code xml literal-block">
@@ -456,56 +461,49 @@ the position of the popup.</li>
456
461
  </span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;view_mode&quot;</span><span class="nt">&gt;</span>tree,form,leaflet_map<span class="nt">&lt;/field&gt;</span><span class="w">
457
462
  </span><span class="nt">&lt;/record&gt;</span>
458
463
  </pre>
459
- <p><strong>Library Update</strong></p>
460
- <p>For the time being, the module embed the lealflet.js library version 1.8.0 ( released on April 18, 2022.)</p>
461
- <p>If a new release is out:</p>
462
- <ul class="simple">
463
- <li>please download it here <a class="reference external" href="https://leafletjs.com/download.html">https://leafletjs.com/download.html</a></li>
464
- <li>update the javascript, css and images, present in the folder <tt class="docutils literal">static/lib/leaflet</tt></li>
465
- <li>test the features</li>
466
- <li>make a Pull Request</li>
467
- </ul>
468
464
  <p><strong>Default position in the map</strong></p>
469
- <p>By default, the position of the map is defined by the user, in the function
470
- <tt class="docutils literal">get_default_leaflet_position</tt>. It returns the position of the current company, if defined.
471
- you can overload this function globally, or per model.</p>
465
+ <p>By default, the position of the map is defined by the user, in the
466
+ function <tt class="docutils literal">get_default_leaflet_position</tt>. It returns the position of
467
+ the current company, if defined. you can overload this function
468
+ globally, or per model.</p>
472
469
  </div>
473
470
  <div class="section" id="known-issues-roadmap">
474
- <h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
471
+ <h2><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h2>
475
472
  <ul class="simple">
476
- <li>For the time being, at the start of the map loading, the call of <tt class="docutils literal">invalidateSize()</tt>
477
- is required. We should investigate why and try to remove that call.
478
- see <a class="reference external" href="https://github.com/Leaflet/Leaflet/issues/3002#issuecomment-93836022">https://github.com/Leaflet/Leaflet/issues/3002#issuecomment-93836022</a></li>
479
- <li>For the time being, the map has “Markers” and allow to display odoo items
480
- if longitude and latitude are available. We could imagine other kind of usages,
481
- with Polylines, Polygons, etc…
482
- See all the leaflet options : <a class="reference external" href="https://leafletjs.com/reference.html">https://leafletjs.com/reference.html</a></li>
473
+ <li>For the time being, at the start of the map loading, the call of
474
+ <tt class="docutils literal">invalidateSize()</tt> is required. We should investigate why and try to
475
+ remove that call. see
476
+ <a class="reference external" href="https://github.com/Leaflet/Leaflet/issues/3002#issuecomment-93836022">https://github.com/Leaflet/Leaflet/issues/3002#issuecomment-93836022</a></li>
477
+ <li>For the time being, the map has “Markers” and allow to display odoo
478
+ items if longitude and latitude are available. We could imagine other
479
+ kind of usages, with Polylines, Polygons, etc… See all the leaflet
480
+ options : <a class="reference external" href="https://leafletjs.com/reference.html">https://leafletjs.com/reference.html</a></li>
483
481
  </ul>
484
482
  </div>
485
483
  <div class="section" id="bug-tracker">
486
- <h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
484
+ <h2><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h2>
487
485
  <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/geospatial/issues">GitHub Issues</a>.
488
486
  In case of trouble, please check there if your issue has already been reported.
489
487
  If you spotted it first, help us to smash it by providing a detailed and welcomed
490
- <a class="reference external" href="https://github.com/OCA/geospatial/issues/new?body=module:%20web_view_leaflet_map%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
488
+ <a class="reference external" href="https://github.com/OCA/geospatial/issues/new?body=module:%20web_view_leaflet_map%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
491
489
  <p>Do not contact contributors directly about support or help with technical issues.</p>
492
490
  </div>
493
491
  <div class="section" id="credits">
494
- <h1><a class="toc-backref" href="#toc-entry-5">Credits</a></h1>
492
+ <h2><a class="toc-backref" href="#toc-entry-5">Credits</a></h2>
495
493
  <div class="section" id="authors">
496
- <h2><a class="toc-backref" href="#toc-entry-6">Authors</a></h2>
494
+ <h3><a class="toc-backref" href="#toc-entry-6">Authors</a></h3>
497
495
  <ul class="simple">
498
496
  <li>GRAP</li>
499
497
  </ul>
500
498
  </div>
501
499
  <div class="section" id="contributors">
502
- <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
500
+ <h3><a class="toc-backref" href="#toc-entry-7">Contributors</a></h3>
503
501
  <ul class="simple">
504
502
  <li>Sylvain LE GAL (<a class="reference external" href="https://www.twitter.com/legalsylvain">https://www.twitter.com/legalsylvain</a>)</li>
505
503
  </ul>
506
504
  </div>
507
505
  <div class="section" id="maintainers">
508
- <h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
506
+ <h3><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h3>
509
507
  <p>This module is maintained by the OCA.</p>
510
508
  <a class="reference external image-reference" href="https://odoo-community.org">
511
509
  <img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -515,10 +513,11 @@ mission is to support the collaborative development of Odoo features and
515
513
  promote its widespread use.</p>
516
514
  <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
517
515
  <p><a class="reference external image-reference" href="https://github.com/legalsylvain"><img alt="legalsylvain" src="https://github.com/legalsylvain.png?size=40px" /></a></p>
518
- <p>This module is part of the <a class="reference external" href="https://github.com/OCA/geospatial/tree/16.0/web_view_leaflet_map">OCA/geospatial</a> project on GitHub.</p>
516
+ <p>This module is part of the <a class="reference external" href="https://github.com/OCA/geospatial/tree/18.0/web_view_leaflet_map">OCA/geospatial</a> project on GitHub.</p>
519
517
  <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
520
518
  </div>
521
519
  </div>
522
520
  </div>
521
+ </div>
523
522
  </body>
524
523
  </html>