Odoo icon

Odoo

Consume Odoo API

Custom Resource → Get

AI-generated

Overview

This node allows you to retrieve a specific record from any custom resource (model) in your Odoo instance using its unique 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 further processing within an n8n workflow.

Practical examples:

  • Fetching a product's details from a custom inventory model by its ID.
  • Retrieving a single invoice or order from a custom sales module for reporting or integration with other systems.

Properties

Name Meaning
Custom Resource Name or ID Choose the Odoo model (custom resource) 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 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.

Output

  • The output will be a JSON object containing the fields of the requested record.
  • Only the fields specified in "Fields to Include" will be present in the output. If no fields are specified, a default set may be returned.
  • Example output structure:
{
  "id": 123,
  "name": "Sample Record",
  "field1": "value1",
  "field2": "value2"
}
  • If an error occurs and "Continue On Fail" is enabled, the output will contain an error property with the error message.

Dependencies

  • Odoo API: Requires access to an Odoo instance with valid credentials (URL, database name, username, password).
  • 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, database, username, and password are correct.
  • Model or ID not found: If the specified custom resource or record ID does not exist, the node will return an error.
  • Missing permissions: The Odoo user must have read access to the selected model and record.

Error messages:

  • "Credentials are not valid": Check your Odoo API credentials.
  • "Settings are not valid: ...": There may be a configuration issue; verify all credential fields.
  • "Record not found" or similar: The provided Custom Resource ID does not exist in the selected model.

Links and References

Discussion