Odoo icon

Odoo

Consume Odoo API

Overview

This node allows you to retrieve a specific record from any custom resource (model) in your Odoo instance by its ID. It is useful when you need to fetch detailed information about a single entry in a custom Odoo model, such as for data enrichment, validation, or integration with other systems. For example, you might use this node to look up a product, order, or any custom entity by its unique identifier and include only the fields you care about.

Practical examples:

  • Fetching a custom "Project" record by its ID to get project details.
  • Retrieving a custom "Invoice" entry for further processing in your workflow.
  • Looking up a user-defined object in Odoo for reporting or automation.

Properties

Name Meaning
Custom Resource Name or ID Choose the Odoo model (custom resource) you want to query. You can select from a list of available models or specify the model name directly using an expression.
Custom Resource ID The unique identifier (ID) of the record you want to retrieve from the selected custom resource. This field is required.
Options → Fields to Include Select which fields of the record to include in the output. You can choose from a list of available fields for the selected model or specify field names/IDs using an expression. If left empty, all fields may be returned.

Output

The output will be a JSON object representing the retrieved record from the specified custom resource. The structure of the output depends on the fields included:

{
  "field1": "value1",
  "field2": "value2",
  ...
}
  • Each key corresponds to a field in the Odoo model.
  • Only the fields selected in "Fields to Include" will appear in the output (if specified).
  • If no fields are specified, the default set of fields for the model may be returned.

Note: This node does not output binary data.

Dependencies

  • Odoo API: Requires access to an Odoo instance with valid credentials (URL, username, password, database name).
  • n8n Credentials: You must configure Odoo API credentials in n8n under the name odooApi.

Troubleshooting

Common issues:

  • Invalid credentials: If the Odoo credentials are incorrect, authentication will fail. Ensure the URL, username, password, and database name are correct.
  • Model or ID not found: If the specified custom resource or record ID does not exist, the node will return an error.
  • Field selection errors: Specifying invalid or misspelled field names in "Fields to Include" may result in missing data or errors.

Error messages and resolutions:

  • "Credentials are not valid": Double-check your Odoo credentials in n8n.
  • "Settings are not valid: ...": There may be a configuration issue; verify all connection parameters.
  • "Record not found" or similar: Ensure the Custom Resource ID exists in the selected model.

Links and References

Discussion