Skip to content

[20.0][ADD] geoengine_advanced_search: inline geo search in the search bar - #497

Open
weinni2000 wants to merge 103 commits into
OCA:20.0from
weinni2000:20.0-add-geoengine_advanced_search
Open

weinni2000 wants to merge 103 commits into
OCA:20.0from
weinni2000:20.0-add-geoengine_advanced_search

Conversation

@weinni2000

Copy link
Copy Markdown

Adds the inline geo search in two new modules:

  • geoengine_advanced_search: spatial operators for geo fields
    (intersects, is within, contains, touches, is geometrically equal to, has a larger/smaller area than, each negated, plus is set /
    is not set) in the search bar and in every domain editor, and a value
    editor that takes a geometry (WKT/GeoJSON) or the records of another model
    picked through one of its geo fields, directly or with a sub-domain.
  • geoengine_advanced_search_logo: shows the image of the records picked as
    value (e.g. the logo or flag of a region), using the first of logo,
    image_128 or avatar_128 the model defines.

Depends on #489 (base_geoengine 20.0 migration): the modules use its geo fields,
its ORM spatial operators and the shared geo domain dialog.

Screenshots

Condition on a geo field

Records of another model as value

Search facet and results

Notes

  • The domain editor widgets are part of the base_geoengine migration ([20.0][MIG] base_geoengine: Migration to 20.0 #489).
    They are copied here on purpose, so the search UI can ship as its own module
    while base_geoengine stays untouched. The duplicates are harmless (this
    module loads after base_geoengine and wins); a follow-up can drop the copy
    from base_geoengine.
  • Base.get_geo_reference_models() is provided here: it lists the models with
    a stored geo field the user can read, for the value selector.
  • geoengine_advanced_search_logo only overrides getImageField(), the
    extension point of the value editor; it does not patch any other component.

Assisted-by: Claude Code (deepseek-flash)

kouffsamuel and others added 30 commits September 29, 2026 09:04
Before this change, simple geometry column were created without inforamtion regarding the geo type nor the defined SRID. Without these information, the srid has to be expliciltely set when converting data to column format.
…had to be use. Add the possibility to have a right internal domain on the right
…method with our alias to perform search method and fix tests
Sanazzzmi and others added 22 commits September 29, 2026 09:04
Currently translated at 100.0% (168 of 168 strings)

Translation: geospatial-17.0/geospatial-17.0-base_geoengine
Translate-URL: https://translation.odoo-community.org/projects/geospatial-17-0/geospatial-17-0-base_geoengine/zh_CN/
Update the geometry string parsing logic to automatically attempt WKB hex loading even if the WKB flag is not explicitly set. This handles cases where a hex string is provided but treated as WKT, falling back to WKT parsing only if hex validation fails.
Upgrades external libraries Chroma.js, Geostats, and OpenLayers to newer versions to ensure compatibility and leverage recent improvements. This includes transition to new folder structures for versioned assets.
Moves OpenLayers, Chroma.js, and Geostats out of the standard asset bundle to a dedicated dynamic loading utility. This centralization prevents potential bundler conflicts and ensures libraries are loaded asynchronously only when required. Updates the GeoEngine renderer and map edit widget to utilize this shared loader for dependency initialization.
   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
The 19.0 migration replaced `_apply_ir_rules` (removed in 19.0) by
`_check_field_access`, which no longer applied row-level security
(ir.rule) to the spatial sub-query of indirect geo operators. As a
result a restricted user could match related records they are not
allowed to read.

Re-apply record rules in `where_calc`, mirroring `BaseModel._search`,
and add a regression test with a non-admin user and an ir.rule.
…(Odoo 19)

res.users.groups_id was renamed to group_ids in Odoo 19, which made
test_geo_search_indirect_respects_record_rules fail with
'Invalid field groups_id in res.users'. Also bump manifest to 19.0.1.0.2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Assisted-by: Claude Code (claude-opus-5-5)
The spatial operators of the geo fields (intersects, is within, contains,
touches, ...) and the value editor picking a geometry or the records of
another model through one of its geo fields were part of base_geoengine.
They are shipped as their own module now; base_geoengine keeps its copy
and its geo domain dialog, which the vector layer editor also uses.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@oca-cla-bot

oca-cla-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

CLA not signed

@OCA-git-bot OCA-git-bot added mod:base_geoengine Module base_geoengine series:20.0 mod:geoengine_advanced_search_logo Module geoengine_advanced_search_logo mod:geoengine_advanced_search Module geoengine_advanced_search labels Nov 16, 2026
@weinni2000
weinni2000 marked this pull request as ready for review November 16, 2026 10:07
…selector

The standard record selector only shows the avatar of a fixed list of
models. This module shows the image of every reference model of the geo
value editor (the first of logo, image_128 or avatar_128 it defines), so
e.g. a region with a logo or flag is recognisable in the value tags.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@weinni2000
weinni2000 force-pushed the 20.0-add-geoengine_advanced_search branch from 1fc3b24 to 13d98c8 Compare November 16, 2026 10:29
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:geoengine_advanced_search_logo Module geoengine_advanced_search_logo mod:geoengine_advanced_search Module geoengine_advanced_search series:20.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.