-
Notifications
You must be signed in to change notification settings - Fork 47
Support the new odoo 18.4 /json/2/ route
#5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
197350f to
4159c0c
Compare
2961b78 to
72965c5
Compare
72965c5 to
97b98aa
Compare
97b98aa to
7295069
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the new JSON/2 route introduced in Odoo 18.4, providing a modern JSON-based API endpoint that uses bearer token authentication instead of username/password. The implementation includes support for both HTTP and HTTPS variants of the JSON/2 protocol.
Key changes:
- Added JSON/2 protocol support with new connectors and connection classes
- Implemented bearer token authentication for JSON/2 endpoints
- Added automatic method introspection for converting positional to named parameters
- Updated test infrastructure to support JSON/2 testing with API keys
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
odoolib/json2.py |
New module implementing JSON/2 specific connectors, connections, and model classes with bearer authentication |
odoolib/rpc.py |
Refactored RPC classes from main.py into dedicated module for better organization |
odoolib/tools.py |
Extracted common utilities and base classes for reuse across different protocols |
odoolib/main.py |
Updated to import from new modules and added JSON/2 protocol support to connection factory methods |
test.py |
Added JSON/2 to test protocols and implemented environment-based API key authentication |
setup.py |
Version bump to 2.0.0 reflecting the major new feature addition |
README.rst |
Updated documentation to explain JSON/2 protocol, SSL support, and compatibility matrix |
ea08371 to
42ef8a6
Compare
The `context` dictionary was not being correctly passed during RPC calls to the Odoo server. This prevented disabling server-side features, such as the VIES VAT check, leading to errors and performance issues. The upstream `odoo-client-lib` has a fix for this in a pending pull request which correctly uses the `execute_kw` RPC method. This commit updates the dependency in `pyproject.toml` to point directly to the head of the pull request to unblock development until the fix is officially merged and released on PyPI. See: odoo/odoo-client-lib#5
|
Thanks for this PR 👍 ✨ |
Odoo 19.0 comes with a new `json/2/` endpoint. this commit makes the library compatible with this new endpoint.
From setup.py to pyproject.toml Added a licence.txt file and removed licence notice in source files.
42ef8a6 to
7374891
Compare
No description provided.