OdooWiki OCA HUB

Base Rest Demo

base_rest_demo folder_open OCA/rest-framework open_in_new
Uncategorised License: LGPL-3

Demo addon to illustrate how to develop self documented REST services thanks to the base_rest addon.

auto_awesome What this module does

AI-generated from the code · Odoo 16.0

This is a demonstration module that exposes example REST API endpoints for partners and a ping service, showing how to build self-documented web services with the Base REST framework.

This module does not add any screens or menus to the Odoo user interface. Instead, it publishes a set of example web service endpoints under the path /base_rest_demo_api/, split into public, private, new API and JWT areas.

  • Public endpoints (no login required) include a ping service that echoes messages back for get, search, create, update and delete calls, and partner lookup services that return partner information such as name, address, phone, country and state.
  • Private endpoints require an authenticated user and allow reading, searching, creating, updating and archiving partners through the res.partner model. A separate service returns a partner's image in small, medium or large size.
  • Additional demo services show the same partner lookups built with the newer API styles and with pydantic models, plus a service that deliberately raises different Odoo exceptions (user error, validation error, access error, missing record, session expired, and others) so developers can see how errors are translated into HTTP responses.
  • A retryable error service simulates a database concurrency conflict and reports how many retries were needed.

The module mainly touches res.partner and uses data models such as partner.info, partner.short.info, partner.search.param, country.info and state.info to describe request and response payloads. It is intended as a technical example for developers, not as an end-user feature.

Models and fields (12)
  • state.info · new modelid, name
  • country.info · new modelid, name
  • partner.info · new modelcity, phone, street, street2, zip_code, is_company
  • ping.service · new model
  • partner.service · new model
  • ping.jwt.service · new model
  • exception.service · new model
  • partner.short.info · new modelid, name
  • partner.search.param · new modelid, name
  • partner_image.service · new model
  • partner.new_api.service · new model
  • partner.pydantic.service · new model

Text generated by AI (DeepSeek) from reading the Odoo 16.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 5 confirmed, 4 with no information of 9 versions.

Sources · Odoo 15.0

Confirmed on 2026-11-03 in branch 15.0 of OCA/rest-framework.

terminal Installation and usage

OCA documentation · Odoo 16.0

This module provides sample REST services based on base_rest. The documentation of provided services is available at the /api-docs URL. This frontend based on Swagger is generated from the implemented webservices.

No verified information in OCA: Installation, Configuration.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.