Odoo icon

Odoo

Consume Odoo API

Overview

The Odoo node for n8n allows you to interact with custom resources in your Odoo instance. Specifically, the Custom Resource → Get Many operation retrieves multiple records from a user-specified Odoo model (custom resource), supporting advanced filtering and field selection. This is useful when you need to extract data from custom tables or modules in Odoo, such as retrieving all entries from a bespoke inventory table, fetching filtered customer records, or exporting lists of custom objects for reporting or integration purposes.

Practical examples:

  • Retrieve all records from a custom "Project Tasks" model, optionally filtering by status or assigned user.
  • Export a list of custom invoices with only selected fields (e.g., invoice number, amount, date).
  • Fetch up to 1000 entries from a custom CRM extension, applying complex filters.

Properties

Name Meaning
Custom Resource Name or ID Select the Odoo model (custom resource) to query. You can choose from a list or specify the model name/ID using an expression.
Return All Whether to return all results matching the criteria (true), or limit the number of results (false).
Limit Maximum number of results to return (only shown if "Return All" is false). Accepts values between 1 and 1000.
Options Additional options for the request:
- Fields to Include: Select which fields to include in the output. Choose from a list or specify field IDs using an expression.
Filters Apply one or more filter conditions to narrow down the results. Each filter consists of:
Field Name or ID: The field to filter on.
Operator: One of !=, <, <=, =, >, >=, Child Of, In, Like, Not In.
Value: The value to compare against.

Output

  • The output is an array of JSON objects, each representing a record from the selected custom resource/model.
  • The structure of each object depends on the fields included via the "Fields to Include" option; typically, each key corresponds to a field in the Odoo model.
  • If no specific fields are selected, default fields may be returned.
  • If an error occurs and "Continue On Fail" is enabled, the output will contain an object with an error property describing the issue.

Example output:

[
  {
    "id": 123,
    "name": "Sample Record",
    "status": "active"
  },
  {
    "id": 124,
    "name": "Another Record",
    "status": "inactive"
  }
]

Dependencies

  • Odoo API: Requires access to an Odoo instance with appropriate permissions for the selected model.
  • Credentials: An n8n credential named odooApi must be configured with the Odoo server URL, database name, username, and password.

Troubleshooting

Common issues:

  • Invalid credentials: If authentication fails, ensure that the Odoo URL, database, username, and password are correct.
  • Model or field not found: If the specified custom resource or field does not exist, check the spelling or use the load options to select valid models/fields.
  • Permission errors: The Odoo user must have read access to the selected model and fields.
  • Filter errors: Using invalid operators or field names in filters may result in errors.

Error messages:

  • "Credentials are not valid": Check your Odoo API credentials.
  • "Settings are not valid: ...": There may be a configuration or connectivity issue.
  • "error": "<message>" in output: Indicates a runtime error for a particular item; review the message for details.

Links and References

Discussion