Odoo Enhanced (PR15676) icon

Odoo Enhanced (PR15676)

Consume Odoo API with enhanced features from PR #15676

Actions6

Overview

This node is designed to retrieve multiple records ("Get Many") from a customizable resource in an Odoo system. It allows users to specify which custom resource (model) to query, apply filters to narrow down the results, and control how many records are returned. This is particularly useful for workflows that need to fetch bulk data from Odoo for processing, reporting, or integration with other systems.

Practical examples include:

  • Fetching all customer records matching certain criteria.
  • Retrieving a limited number of sales orders filtered by date or status.
  • Extracting product information with specific attributes for inventory management.

Properties

Name Meaning
Custom Resource Name or ID Select the custom resource (Odoo model) to query from a list or specify its ID via expression.
Return All Boolean flag to decide whether to return all matching records or limit the output to a specified number.
Limit Maximum number of records to return when "Return All" is false. Minimum value is 1.
Options → Fields to Include Choose which fields of the resource to include in the output. Can select multiple fields or specify them dynamically via expressions.
Custom Filter Enable or disable filtering using a JSON syntax for complex domain filters. When enabled, you provide a JSON array representing the search domain.
Simple Filter (Search Domain Combined Using &) When Custom Filter is disabled, this property allows adding one or more simple search domains combined with logical AND (&). Each search domain consists of:
- Field Name or ID: The field to filter on.
- Operator: Comparison operator such as equals, not equals, less than, like, in, etc.
- Value: The value to compare against.
Multiple such filters can be added.
Custom Filter (string) When Custom Filter toggle is enabled, this multiline string input accepts the JSON-like domain filter syntax used by Odoo to define complex search criteria.

Output

The node outputs an array of JSON objects under the json field, each representing a record retrieved from the specified custom resource. The structure of each object corresponds to the fields selected in the "Fields to Include" option or defaults to all fields if none are specified.

If binary data fields exist in the resource and are included, they will be represented accordingly, but this node primarily focuses on JSON data retrieval.

Dependencies

  • Requires connection to an Odoo instance with appropriate API access.
  • Needs an API authentication token or credential configured in n8n to authorize requests.
  • Utilizes Odoo's ORM search domain syntax for filtering records.
  • The node depends on internal methods for loading available models and their fields dynamically.

Troubleshooting

  • Common Issues:

    • Incorrect or missing API credentials may cause authentication failures.
    • Specifying invalid resource names or IDs will result in errors or empty results.
    • Malformed filter syntax, especially in the custom JSON filter, can cause parsing errors.
    • Requesting too many records without enabling pagination or limits might lead to timeouts or performance issues.
  • Error Messages:

    • Authentication errors: Verify API key/token and permissions.
    • "Resource not found": Check the custom resource name or ID is correct.
    • "Invalid filter format": Ensure the JSON or search domain syntax matches Odoo's expected format.
    • "Limit exceeded": Reduce the number of requested records or enable "Return All" carefully.

Links and References

Discussion