Skip to content

Conversation

@nseinlet
Copy link
Collaborator

No description provided.

@nseinlet nseinlet requested a review from Copilot July 24, 2025 12:23

This comment was marked as outdated.

@nseinlet nseinlet requested a review from tfr-odoo July 24, 2025 12:55
@nseinlet nseinlet requested a review from Copilot July 29, 2025 14:17
Copy link

Copilot AI left a 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

@nseinlet nseinlet force-pushed the upgrade-18.4-nse branch 3 times, most recently from ea08371 to 42ef8a6 Compare July 30, 2025 09:33
bosd pushed a commit to OdooDataFlow/odoo-data-flow that referenced this pull request Aug 7, 2025
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
@bosd
Copy link

bosd commented Aug 8, 2025

Thanks for this PR 👍 ✨
This one also fixes the bug, where the context was not passed down to the .create and .write methods of the model.

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.
@nseinlet nseinlet merged commit 1c1e79b into odoo:master Aug 28, 2025
5 checks passed
@nseinlet nseinlet deleted the upgrade-18.4-nse branch August 28, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants