Tameson Odoo icon

Tameson Odoo

Consume Odoo API

Overview

The Tameson Odoo node for n8n allows you to interact with custom resources in an Odoo instance via its API. Specifically, when using the Custom Resource resource and the Get operation, this node retrieves a single record from a specified custom Odoo model by its ID, optionally including only selected fields.

Common scenarios:

  • Fetching detailed information about a specific custom object (e.g., a custom sales order, invoice, or any user-defined model) from Odoo.
  • Integrating Odoo custom data into other workflows, such as reporting, notifications, or synchronizing with external systems.

Practical example:
You have a custom model in Odoo called x_my_custom_model and want to retrieve the details of a particular record (by its ID) to use in another system or process within your n8n workflow.


Properties

Name Type Meaning
Custom Resource Name or ID options Select the Odoo model to query. You can choose from a list of available models or specify the model name directly using an expression.
Custom Resource ID string The unique identifier (ID) of the record in the selected custom resource/model that you want to retrieve.
Options → Fields to Include multiOptions Specify which fields of the record to include in the output. You can select from a list of available fields or provide field names as IDs.

Output

  • The node outputs a JSON object representing the retrieved record from the specified custom Odoo model.
  • The structure of the output JSON will depend on the fields present in the custom model and those selected in "Fields to Include". Each key corresponds to a field name, and each value is the field's value for the retrieved record.
  • If no fields are specified, all default fields may be returned.

Example output:

{
  "id": 42,
  "name": "Sample Record",
  "custom_field_1": "Value 1",
  "custom_field_2": 123,
  ...
}

Dependencies

  • Odoo Instance: Requires access to an Odoo server with the relevant custom models.
  • API Credentials: Needs valid Odoo API credentials (URL, username, password, database name).
  • n8n Configuration: The node must be configured with the "odooApi" credential type in n8n.

Troubleshooting

Common issues:

  • Invalid Model Name: If the "Custom Resource Name or ID" does not match an existing Odoo model, the node will fail to retrieve data.
  • Incorrect Record ID: Providing a non-existent or invalid "Custom Resource ID" will result in an error or empty output.
  • Missing Fields: Specifying field names in "Fields to Include" that do not exist in the model will cause errors or missing data in the output.
  • Authentication Errors: Invalid Odoo credentials will prevent the node from connecting to the Odoo API.

Error messages and resolutions:

  • "Credentials are not valid": Check your Odoo API credentials and ensure they are correct.
  • "Settings are not valid: ...": Review the Odoo connection settings (URL, database, etc.).
  • "Cannot read property '...' of undefined": Likely due to an incorrect model or field name; verify your selections.

Links and References

Discussion