Skip to content
Health
75/100
good
  • Security25/25
    No findings
  • Activity25/25
    Human commit this month
  • Required by20/25
    2 modules depend on it
  • Maturity5/25
    In 1 Odoo series since 18.0

Heuristic over the facts below, not an audit · How it's computed

Security findings
Grave / minor (static analysis)
Required by
2
Modules depending on it
External deps
2 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.17 MB
Module directory on disk
Code analysis 2 migration notes 5 models 6 views 0 HTTP endpoints

Description

This module provides the webservice.backend model with its authentication (public, username/password, API key) and HTTP call features (get/post/put/delete).

It has no dependency on component or server_environment, so it can be used as a lightweight building block by any module needing to configure and call an outbound webservice, without pulling in extra frameworks.

On top of a backend, you can configure specific, named webservice.endpoint records via the UI, instead of only building calls in Python via webservice.backend.call(method, url_args, ...). Each endpoint bundles a required description, a fixed HTTP method and relative path (appended to the backend URL), static headers, and an optional authentication override, fully independent from the backend's. Endpoints are called with endpoint.call(...); calling the backend directly with backend.call(method, ...) remains fully supported.

Dependencies

Odoo dependencies
odoo/odoo:
Python dependencies
openupgradelib, requests
System dependencies
None
Required by
edi_webservice_core_oca, webservice

Code analysis

Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.

Views touched 6

XML IDNameModelTypeStatus
webservice_backend_form_view webservice.backend.form (in webservice_core) webservice.backend form New
webservice_backend_search_view webservice.backend.search (in webservice_core) webservice.backend search New
webservice_backend_tree_view webservice.backend.tree (in webservice_core) webservice.backend list New
webservice_endpoint_form_view webservice.endpoint.form (in webservice_core) webservice.endpoint form New
webservice_endpoint_search_view webservice.endpoint.search (in webservice_core) webservice.endpoint search New
webservice_endpoint_tree_view webservice.endpoint.tree (in webservice_core) webservice.endpoint list New

HTTP endpoints 0

No HTTP endpoints found for this module.

Models touched 5

New fields (5)
  • company_id Many2one → res.company
    string='Company' args: 'res.company'
  • endpoint_count Integer
    compute='_compute_endpoint_count'
  • endpoint_ids One2many → webservice.endpoint
    string='Endpoints' args: 'webservice.endpoint', 'backend_id'
  • name Char
    required=True
  • url Char
    required=True
Public methods (1)
  • action_view_endpoints(self)

New fields (11)
  • active Boolean
    default=True
  • auth_type Selection
    required=False
  • backend_id Many2one → webservice.backend
    index=True ondelete='cascade' required=True args: 'webservice.backend'
  • company_id Many2one
    readonly=True related='backend_id.company_id' store=True
  • description Text
    required=True
  • http_method Selection
    default='get' required=True args: [('get', 'GET'), ('post', 'POST'), ('put', 'PUT'), ('delete', 'DELETE')]
  • name Char
    required=True
  • override_auth Boolean
    help="Use this endpoint's own authentication instead of the backend's." string='Override Authentication'
  • path Char
    help="Relative path appended to the backend URL. Supports the same '{placeholder}' syntax as the backend URL."
  • protocol Selection
    default='http'
  • tech_name Char
    required=True
Public methods (1)
  • call(self, url_params=None, **kwargs)

New fields (5)
  • name Char
    required=True
  • res_id Many2oneReference
    index=True model_field='res_model' required=True string='Record'
  • res_model Char
    index=True required=True
  • secret Boolean
    help='The value is a secret (e.g. a token or a key): it is hidden in the UI and dropped when the database is neutralized.'
  • value Char
    required=True
Public methods (0)

No public methods.

New fields (5)
  • name Char
    required=True
  • res_id Many2oneReference
    index=True model_field='res_model' required=True string='Record'
  • res_model Char
    index=True required=True
  • secret Boolean
    help='The value is a secret (e.g. a token or a key): it is hidden in the UI and dropped when the database is neutralized.'
  • value Char
    required=True
Public methods (0)

No public methods.

New fields (12)
  • api_key Char
    auth_type='api_key' string='API Key'
  • api_key_header Char
    auth_type='api_key' string='API Key header'
  • auth_type Selection
    required=True selection=[('none', 'Public'), ('user_pwd', 'Username & password'), ('api_key', 'API Key')]
  • content_type Selection
    args: [('application/json', 'JSON'), ('application/xml', 'XML'), ('application/x-www-form-urlencoded', 'Form')]
  • full_url_display Char
    compute='_compute_full_url_display' help="Best-effort absolute URL, ready to copy/paste. Any '{placeholder}' token is left unresolved: fill it in before use."
  • header_ids One2many → webservice.header
    domain=<expr> help='Static default headers, merged into every call. An explicit `headers` kwarg passed to `call()` wins over these.' string='Headers' args: 'webservice.header', 'res_id'
  • password Char
    auth_type='user_pwd'
  • protocol Selection
    required=True args: [('http', 'HTTP Request')]
  • querystring_param_ids One2many → webservice.querystring.param
    domain=<expr> help="Static default querystring params, merged into every call. An explicit `params` kwarg passed to `call()` wins over these. A value may contain a '{placeholder}' resolved against the same values used to fill the URL path (the `url_params` kwarg)." string='Querystring Params' args: 'webservice.querystring.param', 'res_id'
  • tech_name Char
    copy=False help='Unique name for technical purposes. Automatically generated from the name if left empty.' required=True
  • timeout Float
    help='Timeout in seconds for the whole request (connect + read). An explicit `timeout` kwarg passed to `call()` wins over this. Left empty, the call waits indefinitely.'
  • username Char
    auth_type='user_pwd'
Public methods (7)
  • call(self, method, *args, **kwargs)
  • call_delete(self, **kwargs)
  • call_get(self, **kwargs)
  • call_post(self, **kwargs)
  • call_put(self, **kwargs)
  • create(self, vals_list)
    @api.model_create_multi
  • write(self, vals)

Loading…