Skip to content
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

[17.0] rest_api_odoo: Allow queries by model's field #347

Open
wants to merge 2 commits into
base: 17.0
Choose a base branch
from

Conversation

drpsyko101
Copy link

@drpsyko101 drpsyko101 commented Nov 13, 2024

Description

Several enhancements for REST API addon:

  • All requests now can use any fields in the model except for binary objects. This is useful to filter archived records.
  • Fields now support wildcard (*) to output all model fields.
  • Supports pagination by specifying limit or offset in the query parameter.
  • GET request will return ID field if no fields are given.
  • Return proper HTTP error codes and messages in JSON format by default.
  • Allow API key access to users with 2FA enabled.
  • Removed the need for db, login, password & api-key altogether in favour of Odoo API key.
  • Update the module page to reflect the changes above.

Breaking changes

res.users.api_key has been replaced with res.users.apikeys. This will make accessing the previous field returns an error. Simply removing the column from the database should fix the issue. Reinstalling the addon also works if data loss in connection_api is not a concern.

* All requests now can use any fields in the model except for binary
* Fields now support wildcard (*) to output all model fields
* GET request will return ID field if no fields are given
* Return proper HTTP error codes and messages in JSON format by default
* Add pagination support
* This eliminates the need to create an additional unsecure object in the database.
* Using the API token also enables users with 2FA to authenticate against Odoo server
* Added ACL for the Rest API view to allow access to only certain users
* Removed Postman sample as the new methods has been simplified
* Update the module info to reflect changes above
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.

1 participant