Skip to content

[17.0][FIX] base_geoengine: filtered domain geo operators#458

Open
zamberjo wants to merge 2 commits into
OCA:17.0from
heligrafics:fix-filtered-domain-geo-operators
Open

[17.0][FIX] base_geoengine: filtered domain geo operators#458
zamberjo wants to merge 2 commits into
OCA:17.0from
heligrafics:fix-filtered-domain-geo-operators

Conversation

@zamberjo
Copy link
Copy Markdown
Member

Odoo evaluates ir.rule domains in-memory via BaseModel._filter_access_rules_python()filtered_domain(), which has a hardcoded operator dispatch (if/elif chain) that raises ValueError for any operator it doesn't recognize.

While base_geoengine already patches expression.TERM_OPERATORS and __leaf_to_sql to support geo operators (geo_within, geo_intersect, etc.) during SQL query compilation, the Python-side filtered_domain() is a completely separate code path that was never extended.

This fix patches filtered_domain to detect geo operator leaves and fall back to a SQL search() call (where PostGIS can resolve them), following the same delegation pattern Odoo already uses for child_of and parent_of operators.

Non-geo domains are unaffected and continue using the original in-memory evaluation.

@zamberjo zamberjo changed the title Fix filtered domain geo operators [17.0][FIX] base_geoengine: filtered domain geo operators May 15, 2026
@zamberjo zamberjo marked this pull request as draft May 15, 2026 13:47
@zamberjo zamberjo force-pushed the fix-filtered-domain-geo-operators branch from 96f5565 to ecb4fc6 Compare May 15, 2026 13:48
@zamberjo zamberjo marked this pull request as ready for review May 15, 2026 13:48
@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants