Skip to content

[19.0][MIG] base_geoengine: migrate to 19.0#446

Open
leNeo wants to merge 474 commits into
OCA:19.0from
leNeo:19.0
Open

[19.0][MIG] base_geoengine: migrate to 19.0#446
leNeo wants to merge 474 commits into
OCA:19.0from
leNeo:19.0

Conversation

@leNeo
Copy link
Copy Markdown

@leNeo leNeo commented Mar 16, 2026

Summary

  • Migrate base_geoengine module to Odoo 19.0
  • Migrate JavaScript frontend from legacy widgets to OWL/ESM architecture
  • Update bundled libraries: OpenLayers 10.5.0, Chroma.js 3.1.2, Geostats 2.1.0
  • Refactor domain handling with monkey-patching for Odoo 19 ORM compatibility (geo operators integration)
  • Fix OCA compliance issues found during pre-publication review

Changes in this PR

OCA Compliance fixes

  • models/__init__.py: Replace old-style verbose GPL header with standard OCA # Copyright / # License AGPL-3.0 format
  • __init__.py (root): Add missing license header
  • domains.py: Add missing license header
  • readme/HISTORY.md: Add 19.0.1.0.1 changelog entry
  • readme/INSTALL.md: Fix RST syntax (.. code-block:: bash) mixed with Markdown, fix typo "documenation"
  • readme/DESCRIPTION.md: Fix typo "PostgGIS" → "PostGIS"
  • readme/CONTRIBUTORS.md: Remove empty email brackets for contributor entry
  • expressions.py: Replace Python 3.10+ match/case with dict-based dispatch for pre-commit compatibility

Core migration (already done before this PR)

  • JavaScript migrated to ESM modules (.esm.js) with OWL components
  • Domain system adapted for Odoo 19 ORM (DomainCondition monkey-patching)
  • fields.Field._condition_to_sql extended for geo operators
  • Tests updated to use add_to_registry / _setup_models__ (Odoo 19 API)

Pre-commit validation

All hooks pass: pre-commit run --all-files

  • oca-gen-addon-readme, prettier, eslint (0 errors), ruff, ruff-format, pylint_odoo, xml checks

Test plan

  • Install module on a fresh Odoo 19 database with PostGIS enabled
  • Run unit tests: odoo-bin -d test_db -i base_geoengine --test-enable --stop-after-init
  • Verify geoengine view loads correctly in backend
  • Test geo search operators (intersect, contains, within, touch, greater, lesser, equal)
  • Verify raster and vector layer configuration works

@leNeo leNeo mentioned this pull request Mar 16, 2026
1 task
@zamberjo
Copy link
Copy Markdown
Member

zamberjo commented Apr 1, 2026

Nice work, thanks for taking care of the 19.0 migration 🙌

Small suggestion before merge: could you please redo it following the official OCA migration steps so the full commit history from 18.0 is preserved?

Also, could you include PR #449 in this migration as well so 19.0 stays aligned with the previous stable branch?

Thanks!

yvaucher and others added 28 commits April 5, 2026 20:41
Implement propotional
Improve alpha channel management (everythong is ready to enable its configuration on the raster layer)
anusriNPS and others added 10 commits April 5, 2026 20:41
   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.
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/
…dient customization

- Introduced `intermediate_colors` field to `geoengine.vector.layer` model, allowing users to specify comma-separated hex color values for intermediate gradient stops.
- Updated the GeoengineRenderer to utilize the new field for dynamic gradient generation.
- Modified relevant views and documentation to reflect the new feature.
- Version bump to 19.0.1.0.1
- JS modernization: ESM modules, OWL components
- Library updates: OpenLayers 10.5.0, Chroma.js 3.1.2, Geostats 2.1.0
- ORM compatibility: monkey-patch Field._condition_to_sql for geo operators
- Add domains.py for extended domain handling with geo operators
- OCA compliance: license headers, readme updates, typo corrections
- Replace deprecated Python 3.10+ syntax for compatibility
- Update tests with add_to_registry pattern

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… renderer

Add geoengine_swisstopo module providing:
- proj4js support for non-standard SRIDs (EPSG:2056, EPSG:21781, etc.)
- Swisstopo raster layer type for Swiss national map backgrounds
- Automatic SRID detection from geo fields for correct projection handling
- Patched GeoEngine renderer for multi-projection workflows
- CI config update for PostGIS-enabled PostgreSQL image

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@leNeo
Copy link
Copy Markdown
Author

leNeo commented Apr 5, 2026

Hi @zamberjo, thanks for the review and the useful feedback!

I've reworked the PR following the official OCA migration steps:

  • Full 18.0 history preserved: Used git format-patch / git am from upstream/18.0 onto upstream/19.0, so all commit history is intact (468 commits).
  • PR feat(geoengine.vector.layer): add intermediate_colors field for gradient customization #449 included: Cherry-picked your intermediate_colors feature (b444282) so 19.0 stays aligned with 18.0.
  • Migration commit: Applied all 19.0 changes (version bump, JS/OWL modernization, ORM compat, library updates) as a proper [MIG] commit on top.
  • geoengine_swisstopo: Added as a separate commit.

CI is green. Let me know if anything else needs adjusting!

Copy link
Copy Markdown
Member

@zamberjo zamberjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The geoengine_swisstopo module should be in a separate pull request

Comment thread .github/workflows/test.yml
remove geoengine_swisstopo from [19.0][MIG] base_geoengine: migrate to 19.0#446 and submit it in a separate PR for the geoengine_swisstopo module.
@leNeo
Copy link
Copy Markdown
Author

leNeo commented Apr 7, 2026

The geoengine_swisstopo module should be in a separate pull request
Thanks, agreed. I’remove geoengine_swisstopo from [19.0][MIG] base_geoengine

Replace static asset bundle (assets_jsLibs_geoengine) with dynamic
loading via loadJS() to avoid Odoo 19 bundler conflicts. Upgrade
OpenLayers 10.5→10.8 and Chroma.js 3.1.2→3.2.0.

Inspired by weinni2000/geospatial PR OCA#7 (ahkio).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@leNeo leNeo requested a review from zamberjo May 15, 2026 19:10
@leNeo
Copy link
Copy Markdown
Author

leNeo commented May 17, 2026

Hi @zamberjo, @cparadis-impressfoods 👋

This PR is ready for another review round. Quick recap of the changes since your last feedback:

Addressed comments

  • geoengine_swisstopo has been removed from this PR (commit e9b4e04) and will be submitted in a separate PR, as requested.
  • .github/workflows/test.yml PostGIS update has been clarified — same pattern as the 17.0 (#368) and 18.0 (#403) base_geoengine migration PRs (thanks @cparadis-impressfoods for the references).

Latest commits

  • 2781261 refactor(base_geoengine): dynamic JS lib loading and OL/Chroma upgrade
  • cc8daf9 Refactor onWillStart to a single-line function

CI status: all green ✅ (test with Odoo, test with OCB, pre-commit, Detect unreleased dependencies)

Let me know if anything else needs to be adjusted before approval. Thanks for your time!

dnplkndll added a commit to ledoent/geospatial that referenced this pull request May 18, 2026
Extends push-trigger branch list on the ledoent fork so review and
aggregated branches get CI feedback without opening an upstream PR.
The OCA upstream push trigger (19.0, 19.0-ocabot-*) is preserved
verbatim; we only ADD fork-specific patterns.

Used to validate OCA#446's postgis/postgis:14-3.5 service change against
the integrated 5-module stack on 19.0-aggregated. Mirrors the same
pattern from openupgrade-lab's test-migration.yml fork extensions.
dnplkndll added a commit to ledoent/oca-addons-repo-template that referenced this pull request May 18, 2026
Adds a boolean copier option (default: no) that swaps the CI postgres
service from the vanilla image to postgis/postgis:<pg>-<postgis> when
the repo installs Odoo modules that need PostGIS (geo_* field types,
base_geoengine, etc.).

WHY

Today, every PR on OCA/geospatial needs to hand-patch
.github/workflows/test.yml to swap the postgres image, otherwise
'CREATE EXTENSION postgis' fails at install time and the test job dies
with 'could not open extension control file postgis.control'.

The 17.0 and 18.0 branches of OCA/geospatial already shipped a
postgis/postgis:13-3.4 override, but each copier update wipes that
modification — so reviewers see the workflow patch as 'out of scope'
on every cohort PR and authors have to defend it (see e.g. OCA/geospatial#446
where the workflow change triggered a multi-turn thread).

This flag makes the override declarative — set 'postgis_extension: yes'
once in copier-answers.yml, and the workflow regenerates with the
right image on every future copier update.

IMAGE CHOICE

Conservative defaults aligned with the existing postgres-version ladder:
  - odoo_version < 16  -> postgis/postgis:13-3.4
  - 16 <= odoo_version < 19 -> postgis/postgis:13-3.4
  - odoo_version >= 19 -> postgis/postgis:14-3.5

VALIDATION

Tested against the integrated OCA/geospatial 19.0 cohort (PRs #446 + #450
+ #451 + #452 + #453) merged on a fork branch:
https://github.com/ledoent/geospatial/actions/runs/26052247018
All three test jobs (test with Odoo, test with OCB, Detect unreleased
dependencies) pass green with postgis/postgis:14-3.5 driving install
+ tests for base_geoengine + geoengine_partner + geoengine_base_geolocalize
+ website_geoengine + website_geoengine_store_locator.

OPT-IN BEHAVIOR

Default is 'no'. Repos with no geo modules see zero diff after copier
update; the postgres:* images stay exactly as today.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.