[19.0][FIX] endpoint: validate registry sync - #152
Open
le-goff-benoit wants to merge 1 commit into
Open
Conversation
Contributor
|
Hi @simahawk, |
An unknown URL converter prevents Odoo from building the global routing map. Validate active endpoints before they can be synchronized to the registry. Also check endpoint snippets for safe_eval syntax and unavailable global variables. Keep invalid endpoints editable and allow inactive records to sync so stale registry rules can be removed.
le-goff-benoit
force-pushed
the
validate-endpoint-registry-sync
branch
from
August 18, 2026 14:26
312e5c7 to
7f4722c
Compare
le-goff-benoit
marked this pull request as ready for review
August 18, 2026 14:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
ir.httpsafe_evalsyntax and detect unavailable global variablesendpoint_routeWhy
Werkzeug compiles every registered URL rule while Odoo builds its global routing map. A dynamic endpoint using an unknown converter, such as
<date:value>, raises aLookupErrorand prevents the entire routing map from being built. This makes every application route return an error, not only the invalid endpoint.Endpoint code snippets can also reference names that are not part of the
safe_evalcontext. For example,date(...)is not available, whiledatetimeis.The endpoint model already separates editing from publication through the
registry_syncaction. This change uses that boundary to report actionable errors without preventing users from saving an invalid draft.User impact
When an active invalid endpoint is synchronized, the user now receives a
UserErrorlisting the affected endpoint and its route or code errors. No invalid rule is written to the registry. After correcting the endpoint, the same synchronization action publishes it normally.Validation
py3.10-odoo19.0): 102 tests, 0 failures, 0 errorssafe_evalsyntax, unavailable system variables, accepted built-ins, draft persistence, successful synchronization after correction, and removal of an invalid inactive route