Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
16b31f4
[ADD] New module extending base_geolocalize
lmignon Mar 10, 2015
4d46547
[FIX] add missing api decorator
lmignon Mar 31, 2015
0a490a5
[FIX] Add bug tracker url to the module description
lmignon Jun 2, 2015
cb1bd32
Use the Nominatim service of OpenStreetMap to retrieve OSM data by ad…
lmignon Jun 2, 2015
9720990
[IMP] Use the countryCode when querying OSM
lmignon Jun 2, 2015
fcdf99b
[IMP] Use the countryCode and the country name when querying OSM
lmignon Jun 2, 2015
c2aba4a
[PEP8]
lmignon Jun 2, 2015
555b8a6
[FIX] log message
lmignon Jun 2, 2015
38b3305
[FIX] Better naming
lmignon Jun 2, 2015
95c5dee
[ADD] some tests
Jun 2, 2015
bf868d3
[FIX] Adapt tests since the coordinates returned by OSM are not the s…
lmignon Jun 3, 2015
8efc4b8
[CHG]
Jul 17, 2015
0dbe0d3
[UPD] prefix versions with 8.0
sbidoul Oct 9, 2015
a0671d8
[MIG] Make modules uninstallable
pedrobaeza Oct 14, 2015
0a3e296
[MIG] Rename manifest files
pedrobaeza Oct 6, 2016
ed58f5d
[FIX] Replace openerp imports
ecino Apr 20, 2018
5a72509
[MIG] geoengine_base_geolocalize migration
benwillig Oct 2, 2017
ec6d7a2
split the search for address using OSM + testing
lmarion-source Jun 2, 2020
0cf22c0
[FIX] code format and pylint:
lmarion-source Jun 2, 2020
7938bff
geoengine_base_geolocalize 10.0.1.0.1
OCA-git-bot Jun 19, 2020
d22321b
[16.0][MIG] - geoengine_base_geolocalize
sbejaoui Mar 6, 2023
d83517f
Added translation using Weblate (Italian)
mymage Jan 26, 2024
4f3fa13
[IMP] geoengine_base_geolocalize: pre-commit auto fixes
Oct 28, 2024
e476eda
[MIG] geoengine_base_geolocalize: Migration to 17.0
Oct 28, 2024
5fe5ea8
Added translation using Weblate (Chinese (Simplified) (zh_CN))
xtanuiha Nov 25, 2024
97e8a1a
[FIX] geoengine_base_geoengine: avoid external calls in unit tests
yvaucher Feb 25, 2026
8d24959
Refactor _request_handler to simplify response setup
yvaucher Feb 26, 2026
f4ee6b8
Remove unused artifact
yvaucher Feb 26, 2026
426f68a
[IMP] geoengine_base_geolocalize: pre-commit auto fixes
cparadis-impressfoods Apr 10, 2026
685caad
[MIG] geoengine_base_geolocalize: Migration to 19.0
cparadis-impressfoods Apr 10, 2026
f654a02
[DON'T MERGE] test-requirements.txt
cparadis-impressfoods Apr 10, 2026
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
98 changes: 98 additions & 0 deletions geoengine_base_geolocalize/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=======================================
Geospatial support for base_geolocalize
=======================================

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

.. |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/geoengine_base_geolocalize
: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-geoengine_base_geolocalize
: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|

Geolocalise your partner based on longitude and latitude provided by
`OpenStreetMap via its Nominatim
service <http://wiki.openstreetmap.org/wiki/Nominatim>`__. Please read
carefully the `usage
policy <https://operations.osmfoundation.org/policies/nominatim/>`__
before using the module.

**Table of contents**

.. contents::
:local:

Installation
============

Take a look at the installation section in the description of the module
'base_geoengine'.

The module also requires one additional python libs:

- `requests <https://pypi.python.org/pypi/requests>`__

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

* ACSONE SA/NV

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

- Laurent Mignon <laurent.mignon@acsone.eu>
- `APSL-Nagarro <https://www.apsl.tech>`__:

- Antoni Marroig <amarroig@apsl.net>

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.

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
20 changes: 20 additions & 0 deletions geoengine_base_geolocalize/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
##############################################################################
#
# Author: Laurent Mignon
# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import models
15 changes: 15 additions & 0 deletions geoengine_base_geolocalize/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2015-2017 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Geospatial support for base_geolocalize",
"version": "19.0.1.0.0",
"category": "GeoBI",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/geospatial",
"depends": ["base", "geoengine_partner", "base_geolocalize"],
"external_dependencies": {"python": ["requests"]},
"data": ["views/res_partner_view.xml"],
"application": True,
"autoinstall": True,
}
25 changes: 25 additions & 0 deletions geoengine_base_geolocalize/i18n/geoengine_base_geolocalize.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:
# * geoengine_base_geolocalize
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.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: geoengine_base_geolocalize
#: model:ir.model.fields,field_description:geoengine_base_geolocalize.field_res_partner__geo_point
#: model:ir.model.fields,field_description:geoengine_base_geolocalize.field_res_users__geo_point
msgid "Address coordinates"
msgstr ""

#. module: geoengine_base_geolocalize
#: model:ir.model,name:geoengine_base_geolocalize.model_res_partner
msgid "Contact"
msgstr ""
28 changes: 28 additions & 0 deletions geoengine_base_geolocalize/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:
# * geoengine_base_geolocalize
#
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: geoengine_base_geolocalize
#: model:ir.model.fields,field_description:geoengine_base_geolocalize.field_res_partner__geo_point
#: model:ir.model.fields,field_description:geoengine_base_geolocalize.field_res_users__geo_point
msgid "Address coordinates"
msgstr "Coordinate indirizzo"

#. module: geoengine_base_geolocalize
#: model:ir.model,name:geoengine_base_geolocalize.model_res_partner
msgid "Contact"
msgstr "Contatto"
28 changes: 28 additions & 0 deletions geoengine_base_geolocalize/i18n/zh_CN.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:
# * geoengine_base_geolocalize
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-11-25 09:06+0000\n"
"Last-Translator: xtanuiha <feihu.zhang@live.com>\n"
"Language-Team: none\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 5.6.2\n"

#. module: geoengine_base_geolocalize
#: model:ir.model.fields,field_description:geoengine_base_geolocalize.field_res_partner__geo_point
#: model:ir.model.fields,field_description:geoengine_base_geolocalize.field_res_users__geo_point
msgid "Address coordinates"
msgstr "地址坐标"

#. module: geoengine_base_geolocalize
#: model:ir.model,name:geoengine_base_geolocalize.model_res_partner
msgid "Contact"
msgstr "联系人"
1 change: 1 addition & 0 deletions geoengine_base_geolocalize/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import res_partner
41 changes: 41 additions & 0 deletions geoengine_base_geolocalize/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2015 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import api, fields, models


class ResPartner(models.Model):
"""Add geo_point to partner using a function field"""

_inherit = "res.partner"

@api.depends("partner_latitude", "partner_longitude")
def _compute_geo_point(self):
"""
Set the `geo_point` of the partner depending of its `partner_latitude`
and its `partner_longitude`
**Notes**
If one of those parameters is not set then reset the partner's
geo_point and do not recompute it
"""
for rec in self:
if not rec.partner_latitude or not rec.partner_longitude:
rec.geo_point = False
else:
rec.geo_point = fields.GeoPoint.from_latlon(
rec.env.cr, rec.partner_latitude, rec.partner_longitude
)

geo_point = fields.GeoPoint(
store=True, compute="_compute_geo_point", inverse="_inverse_geo_point"
)

def _inverse_geo_point(self):
for rec in self:
if not rec.geo_point:
rec.partner_longitude, rec.partner_latitude = False, False
else:
(
rec.partner_longitude,
rec.partner_latitude,
) = fields.GeoPoint.to_latlon(rec.env.cr, rec.geo_point)
3 changes: 3 additions & 0 deletions geoengine_base_geolocalize/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions geoengine_base_geolocalize/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Laurent Mignon \<<laurent.mignon@acsone.eu>\>
- [APSL-Nagarro](https://www.apsl.tech):
- Antoni Marroig \<<amarroig@apsl.net>\>
3 changes: 3 additions & 0 deletions geoengine_base_geolocalize/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Geolocalise your partner based on longitude and latitude provided by
[OpenStreetMap via its Nominatim service](http://wiki.openstreetmap.org/wiki/Nominatim). Please read carefully the
[usage policy](https://operations.osmfoundation.org/policies/nominatim/) before using the module.
6 changes: 6 additions & 0 deletions geoengine_base_geolocalize/readme/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Take a look at the installation section in the description of the module
'base_geoengine'.

The module also requires one additional python libs:

- [requests](https://pypi.python.org/pypi/requests)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading