Maintainers
Current maintainer:
This module is part of the ecosoft-odoo/ecosoft-addons project on GitHub.
You are welcome to contribute.
This module provides a reusable framework for making outbound API calls from Odoo to external systems.
It ships three key components:
Table of contents
To use this method:
Go to menu Settings > Technical > Web Services > API Exports.
Create a new record and fill in the following fields:
Configure the JSON / Payload tab with a Python expression that evaluates to a dict or list. Available variables:
Example:
{"name": rec.name, "ref": rec.ref, "amount": rec.amount_total}
For REST API, optionally configure the Params tab with a Python expression returning a dict of URL query parameters (e.g. {"page": 1, "lang": "th"}).
Configure Result Mapping to tell the module how to interpret the remote response:
Click the Test API button on the configuration form to execute a test call. The result (or error) is displayed in the Test Result tab.
To add outbound API capability to your own model:
Inherit the common.base.api mixin:
class MyModel(models.Model):
_name = "my.model"
_inherit = ["my.model", "common.base.api"]
Call the API by code:
self.action_call_api("MY_API_CODE")
Override _hook_update_data to process the response:
def _hook_update_data(self, code_api, result):
if code_api == "MY_API_CODE":
# REST: result is the parsed JSON dict
# XML-RPC: result is {"is_success": True, "result": <raw>}
self.write({"external_id": result.get("id")})
The mixin automatically handles authentication, request execution, error handling, status updates (api_status), and log creation.
Navigate to Settings > Technical > Web Services > Outbound API Logs to review all outgoing API call history. Each log entry records:
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
Current maintainer:
This module is part of the ecosoft-odoo/ecosoft-addons project on GitHub.
You are welcome to contribute.