odoo-addon-web-view-leaflet-map 16.0.2.0.0.1__py3-none-any.whl → 18.0.1.0.0.3__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 (30) hide show
  1. odoo/addons/web_view_leaflet_map/README.rst +74 -76
  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/fr.po +1 -0
  5. odoo/addons/web_view_leaflet_map/i18n/it.po +1 -0
  6. odoo/addons/web_view_leaflet_map/i18n/web_view_leaflet_map.pot +1 -8
  7. odoo/addons/web_view_leaflet_map/models/ir_ui_view.py +3 -0
  8. odoo/addons/web_view_leaflet_map/readme/CONFIGURE.md +1 -0
  9. odoo/addons/web_view_leaflet_map/readme/CONTRIBUTORS.md +1 -0
  10. odoo/addons/web_view_leaflet_map/readme/DESCRIPTION.md +13 -0
  11. odoo/addons/web_view_leaflet_map/readme/DEVELOP.md +53 -0
  12. odoo/addons/web_view_leaflet_map/readme/ROADMAP.md +8 -0
  13. odoo/addons/web_view_leaflet_map/static/description/index.html +82 -92
  14. odoo/addons/web_view_leaflet_map/static/src/components/map-component/map_view.esm.js +329 -0
  15. odoo/addons/web_view_leaflet_map/static/src/components/map-component/map_view.xml +19 -0
  16. {odoo_addon_web_view_leaflet_map-16.0.2.0.0.1.dist-info → odoo_addon_web_view_leaflet_map-18.0.1.0.0.3.dist-info}/METADATA +81 -82
  17. odoo_addon_web_view_leaflet_map-18.0.1.0.0.3.dist-info/RECORD +26 -0
  18. {odoo_addon_web_view_leaflet_map-16.0.2.0.0.1.dist-info → odoo_addon_web_view_leaflet_map-18.0.1.0.0.3.dist-info}/WHEEL +1 -1
  19. odoo_addon_web_view_leaflet_map-18.0.1.0.0.3.dist-info/top_level.txt +1 -0
  20. odoo/addons/web_view_leaflet_map/readme/CONFIGURE.rst +0 -1
  21. odoo/addons/web_view_leaflet_map/readme/CONTRIBUTORS.rst +0 -1
  22. odoo/addons/web_view_leaflet_map/readme/DESCRIPTION.rst +0 -11
  23. odoo/addons/web_view_leaflet_map/readme/DEVELOP.rst +0 -62
  24. odoo/addons/web_view_leaflet_map/readme/ROADMAP.rst +0 -8
  25. odoo/addons/web_view_leaflet_map/static/src/js/view/map/map_renderer.js +0 -178
  26. odoo/addons/web_view_leaflet_map/static/src/js/view/map/map_view.js +0 -34
  27. odoo/addons/web_view_leaflet_map/static/src/js/view/view_registry.js +0 -8
  28. odoo_addon_web_view_leaflet_map-16.0.2.0.0.1.dist-info/RECORD +0 -27
  29. odoo_addon_web_view_leaflet_map-16.0.2.0.0.1.dist-info/top_level.txt +0 -1
  30. /odoo/addons/web_view_leaflet_map/static/src/{css → components/map-component}/web_view_leaflet_map.css +0 -0
@@ -7,7 +7,7 @@ Leaflet Map View (OpenStreetMap)
7
7
  !! This file is generated by oca-gen-addon-readme !!
8
8
  !! changes will be overwritten. !!
9
9
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
- !! source digest: sha256:f494ec35cbd29ae4bcc5e46a7a30bf5b2261bd449a3b0ba08a95a70d45dbea12
10
+ !! source digest: sha256:52ae60ed2032c73f0ba6fc8ca70e2a2fc73bb12745aeeda793042efb1175c1b9
11
11
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
12
 
13
13
  .. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
@@ -17,28 +17,34 @@ Leaflet Map View (OpenStreetMap)
17
17
  :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18
18
  :alt: License: AGPL-3
19
19
  .. |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
20
+ :target: https://github.com/OCA/geospatial/tree/18.0/web_view_leaflet_map
21
21
  :alt: OCA/geospatial
22
22
  .. |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
23
+ :target: https://translation.odoo-community.org/projects/geospatial-18-0/geospatial-18-0-web_view_leaflet_map
24
24
  :alt: Translate me on Weblate
25
25
  .. |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
26
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/geospatial&target_branch=18.0
27
27
  :alt: Try me on Runboat
28
28
 
29
29
  |badge1| |badge2| |badge3| |badge4| |badge5|
30
30
 
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/)
31
+ This module extends odoo views, to add a new kind of view, named
32
+ ``leaflet_map`` that is using the Leaflet javascript library to use
33
+ maps. (https://leafletjs.com/) This library is for exemple, used in the
34
+ OpenStreetMap project. (https://www.openstreetmap.org/)
34
35
 
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``)
36
+ You can see a simple usage in the module
37
+ ``web_view_leaflet_map_partner`` in the same OCA repository that
38
+ displays your contact in a map, if latitude and longitude are defined.
39
+ (To define latitude and longitude, refer to the Odoo module
40
+ ``base_geolocalize``)
38
41
 
39
- .. figure:: https://raw.githubusercontent.com/OCA/geospatial/16.0/web_view_leaflet_map/static/description/view_res_partner_map_1.png
42
+ |image1|
40
43
 
41
- .. figure:: https://raw.githubusercontent.com/OCA/geospatial/16.0/web_view_leaflet_map/static/description/view_res_partner_map_2.png
44
+ |image2|
45
+
46
+ .. |image1| image:: https://raw.githubusercontent.com/OCA/geospatial/18.0/web_view_leaflet_map/static/description/view_res_partner_map_1.png
47
+ .. |image2| image:: https://raw.githubusercontent.com/OCA/geospatial/18.0/web_view_leaflet_map/static/description/view_res_partner_map_2.png
42
48
 
43
49
  .. IMPORTANT::
44
50
  This is an alpha version, the data model and design can change at any time without warning.
@@ -53,85 +59,77 @@ defined. (To define latitude and longitude, refer to the Odoo module ``base_geol
53
59
  Configuration
54
60
  =============
55
61
 
56
- * See configuration of the module ``web_leaflet_lib``.
62
+ - See configuration of the module ``web_leaflet_lib``.
57
63
 
58
64
  Development
59
65
  ===========
60
66
 
61
67
  Create a new view :
62
68
 
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.
69
+ .. code:: xml
70
+
71
+ <record id="view_my_model_map" model="ir.ui.view">
72
+ <field name="model">my.model</field>
73
+ <field name="arch" type="xml">
74
+ <leaflet_map
75
+ field_latitude="FIELD_LATITUDE"
76
+ field_longitude="FIELD_LONGITUDE"
77
+ field_title="FIELD_TITLE"
78
+ field_address="FIELD_ADDRESS"
79
+ field_marker_icon_image="FIELD_MARKER_ICON_IMAGE"
80
+ >
81
+ <field name="__last_update"/>
82
+ <field name="FIELD_LATITUDE"/>
83
+ <field name="FIELD_LONGITUDE"/>
84
+ <field name="FIELD_TITLE"/>
85
+ <field name="FIELD_ADDRESS"/>
86
+ </leaflet_map>
87
+ </field>
88
+ </record>
89
+
90
+ 1. FIELD_LATITUDE and FIELD_LONGITUDE are the name of the fields that
91
+ contains GPS coordinates of the model.
85
92
  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.
93
+ 3. FIELD_ADDRESS will be used when the popup is displayed to display the
94
+ adress.
95
+ 4. (optional) FIELD_MARKER_ICON_IMAGE, is the name of the image field to
96
+ place as an icon of the marker. Note: You can set extra settings
97
+ ``marker_icon_size_x``, ``marker_icon_size_y``, to define the size of
98
+ the image, and ``marker_popup_anchor_x``, ``marker_popup_anchor_y``
99
+ to define the position of the popup.
92
100
 
93
101
  Map options :
94
102
 
95
103
  - ``default_zoom`` : define the default zoom value. (7 if not defined)
96
104
  - ``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
102
-
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>
105
+ - ``zoom_snap`` : define the zoom level in each change. (1 if not
106
+ defined)
107
+ - Create or update an action for the model
106
108
 
107
- **Library Update**
109
+ .. code:: xml
108
110
 
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
111
+ <record id="my_module.action_my_model" model="ir.actions.act_window">
112
+ <field name="view_mode">tree,form,leaflet_map</field>
113
+ </record>
117
114
 
118
115
  **Default position in the map**
119
116
 
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.
117
+ By default, the position of the map is defined by the user, in the
118
+ function ``get_default_leaflet_position``. It returns the position of
119
+ the current company, if defined. you can overload this function
120
+ globally, or per model.
123
121
 
124
122
  Known issues / Roadmap
125
123
  ======================
126
124
 
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
125
+ - For the time being, at the start of the map loading, the call of
126
+ ``invalidateSize()`` is required. We should investigate why and try to
127
+ remove that call. see
128
+ https://github.com/Leaflet/Leaflet/issues/3002#issuecomment-93836022
129
+ - For the time being, the map has "Markers" and allow to display odoo
130
+ items if longitude and latitude are available. We could imagine other
131
+ kind of usages, with Polylines, Polygons, etc... See all the leaflet
132
+ options : https://leafletjs.com/reference.html
135
133
 
136
134
  Bug Tracker
137
135
  ===========
@@ -139,7 +137,7 @@ Bug Tracker
139
137
  Bugs are tracked on `GitHub Issues <https://github.com/OCA/geospatial/issues>`_.
140
138
  In case of trouble, please check there if your issue has already been reported.
141
139
  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**>`_.
140
+ `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
141
 
144
142
  Do not contact contributors directly about support or help with technical issues.
145
143
 
@@ -147,17 +145,17 @@ Credits
147
145
  =======
148
146
 
149
147
  Authors
150
- ~~~~~~~
148
+ -------
151
149
 
152
150
  * GRAP
153
151
 
154
152
  Contributors
155
- ~~~~~~~~~~~~
153
+ ------------
156
154
 
157
- * Sylvain LE GAL (https://www.twitter.com/legalsylvain)
155
+ - Sylvain LE GAL (https://www.twitter.com/legalsylvain)
158
156
 
159
157
  Maintainers
160
- ~~~~~~~~~~~
158
+ -----------
161
159
 
162
160
  This module is maintained by the OCA.
163
161
 
@@ -177,6 +175,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
177
175
 
178
176
  |maintainer-legalsylvain|
179
177
 
180
- This module is part of the `OCA/geospatial <https://github.com/OCA/geospatial/tree/16.0/web_view_leaflet_map>`_ project on GitHub.
178
+ This module is part of the `OCA/geospatial <https://github.com/OCA/geospatial/tree/18.0/web_view_leaflet_map>`_ project on GitHub.
181
179
 
182
180
  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.0",
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';")
@@ -47,6 +47,7 @@ msgstr "Vue"
47
47
  #. module: web_view_leaflet_map
48
48
  #: model:ir.model.fields,field_description:web_view_leaflet_map.field_ir_actions_act_window_view__view_mode
49
49
  #: model:ir.model.fields,field_description:web_view_leaflet_map.field_ir_ui_view__type
50
+ #: model:ir.model.fields,field_description:web_view_leaflet_map.field_website_page__type
50
51
  msgid "View Type"
51
52
  msgstr "Type de Vue"
52
53
 
@@ -47,5 +47,6 @@ msgstr "Vista"
47
47
  #. module: web_view_leaflet_map
48
48
  #: model:ir.model.fields,field_description:web_view_leaflet_map.field_ir_actions_act_window_view__view_mode
49
49
  #: model:ir.model.fields,field_description:web_view_leaflet_map.field_ir_ui_view__type
50
+ #: model:ir.model.fields,field_description:web_view_leaflet_map.field_website_page__type
50
51
  msgid "View Type"
51
52
  msgstr "Tipo vista"
@@ -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"
@@ -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>