Skip to content

[19.0][MIG] base_geoengine#459

Open
Jonasaaaa wants to merge 553 commits into
OCA:19.0from
Jonasaaaa:19.0-mig-geospatial
Open

[19.0][MIG] base_geoengine#459
Jonasaaaa wants to merge 553 commits into
OCA:19.0from
Jonasaaaa:19.0-mig-geospatial

Conversation

@Jonasaaaa
Copy link
Copy Markdown

Migration of the geospatial repository (5 modules) from 18.0 to 19.0.

Modules migrated:

  • base_geoengine
  • web_leaflet_lib
  • web_leaflet_draw_lib
  • web_view_leaflet_map
  • web_view_leaflet_map_partner

Main changes in base_geoengine:

  • Replaced the monkey patch on BaseModel._condition_to_sql by an
    @operator_optimization hook returning a Domain.custom(to_sql=...).
  • Replaced f-string SQL composition by odoo.tools.SQL with
    SQL.identifier(...) for proper alias/column quoting.
  • odoo.osv.expression.ANDodoo.fields.Domain.AND in
    Base.geo_search.

The remaining four modules only required manifest version bumps; their
JS already uses @odoo/owl imports introduced in 17.0/18.0.

asaunier and others added 30 commits May 22, 2026 17:11
Add note about geometry fields to be listed in geoengine view definitions
Fix some linting issues
It prevents closed cursor errors, most likely dued to using a mock in the tests.
This allow to declare a Geo field using fields instead of having
to import them directly from geoengine module.
With this import of GeoModel is not needed anymore giving to all classes the ability to have geo fields.
Using geo fields on AbstractModels is made possible.
EPSG:3857 is the official name for the spherical pseudo-mercator coordinate system.
The unofficial 900913 code is deprecated and should not be used as the default anymore.
Change fit(extent) as map size is not necessary anymore.
And improve the test on extent, to not try to fit extent when
no features are defined.
- ESlint - ignore libs imported as global
anusriNPS and others added 14 commits May 22, 2026 17:12
   Updated field label from "Params" to "Params WMS"
of params_wms
   attribute_field_id domain is updated to use values
based on geo_field_id.model_id
   Added edit button in popup of record shown in geoengine
view which allows user to edit values of record from
geoengine view.
- rename folder to follow odoo and OCA conventions, regarding views definition
- isolate leaflet_map_view code
- isolate leaflet_map_controller code
- isolate leaflet_map_renderer code
- split xml file into renderer and controller part
- apply Odoo SA convention

[FIX] remove useless logs, and put a single one in debug level
- remove useless code
- remove obsolete directive: control-panel-bottom-right

[IMP] web_view_leaflet_map: introduce 'Create' Button
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: geospatial-18.0/geospatial-18.0-web_view_leaflet_map
Translate-URL: https://translation.odoo-community.org/projects/geospatial-18-0/geospatial-18-0-web_view_leaflet_map/
Currently translated at 100.0% (6 of 6 strings)

Translation: geospatial-18.0/geospatial-18.0-web_view_leaflet_map
Translate-URL: https://translation.odoo-community.org/projects/geospatial-18-0/geospatial-18-0-web_view_leaflet_map/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: geospatial-18.0/geospatial-18.0-base_geoengine
Translate-URL: https://translation.odoo-community.org/projects/geospatial-18-0/geospatial-18-0-base_geoengine/
Currently translated at 100.0% (169 of 169 strings)

Translation: geospatial-18.0/geospatial-18.0-base_geoengine
Translate-URL: https://translation.odoo-community.org/projects/geospatial-18-0/geospatial-18-0-base_geoengine/it/
Switch GeoOperator helpers and _geo_condition_to_sql to build odoo.tools.SQL
objects with SQL.identifier-quoted aliases/columns, instead of f-string
concatenation plus an out-parameter params list. Drop redundant guards in
_geo_condition_to_sql now that @operator_optimization + the GeoField filter
in _optimize_geo_condition already guarantee both invariants.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@OCA-git-bot OCA-git-bot added series:19.0 mod:base_geoengine Module base_geoengine mod:web_leaflet_lib Module web_leaflet_lib mod:web_view_leaflet_map_partner Module web_view_leaflet_map_partner mod:web_leaflet_draw_lib Module web_leaflet_draw_lib mod:web_view_leaflet_map Module web_view_leaflet_map labels May 22, 2026
Jonasaaaa added 10 commits May 26, 2026 10:08
…olumn

``convert_to_cache`` stores geometries as hex-encoded WKB
(``value.wkb_hex``). When the ORM later flushes a write, it forwards
that cached hex string to ``convert_to_column``, which previously
passed it straight to ``entry_to_shape`` → ``value_to_shape``. There
the string was loaded with ``wkt.loads`` (use_wkb=False), raising
``shapely.errors.GEOSException: ParseException: Unknown type``.

Detect hex strings in ``convert_to_column`` and decode them via
``load_geo`` (which already handles hex WKB) before forwarding to
``entry_to_shape``. Other input types (geojson, WKT, BaseGeometry)
go through the existing path unchanged.

Reproduces by setting a GeoPoint field from a computed value (e.g.
``fields.GeoPoint.from_latlon``) and flushing; without this fix
the first write fails on ``shapely.errors.GEOSException``.
Odoo 19's ``RelationalModel._getNextConfig`` calls ``config.groupBy.map(...)``
unconditionally, so ``groupBy`` must be an Array. The geoengine
renderer's ``loadView`` was passing ``groupBy: {}`` (object literal),
producing on first render:

    TypeError: config.groupBy.map is not a function
        at RelationalModel._getNextConfig
        at GeoengineRenderer.loadView
        at GeoengineRenderer.loadVectorModel

Reproduces by opening any geoengine view in Odoo 19.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:base_geoengine Module base_geoengine mod:web_leaflet_draw_lib Module web_leaflet_draw_lib mod:web_leaflet_lib Module web_leaflet_lib mod:web_view_leaflet_map_partner Module web_view_leaflet_map_partner mod:web_view_leaflet_map Module web_view_leaflet_map series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.