Odoo Enhanced (PR15676) icon

Odoo Enhanced (PR15676)

Consume Odoo API with enhanced features from PR #15676

Actions6

Overview

This custom node is designed to retrieve a specific record from a user-defined "Custom Resource" by its ID. It allows users to select the resource type dynamically and specify which fields of that resource they want to include in the output. This node is useful when you need to fetch detailed information about a particular item within a flexible data model, such as retrieving a customer profile, product details, or any other entity defined as a custom resource.

Practical examples:

  • Fetching a single customer record by its unique ID to display or process customer data.
  • Retrieving a specific product's details including selected fields like price, description, and stock availability.
  • Accessing a custom entity in an ERP or CRM system where resources and their fields are dynamically defined.

Properties

Name Meaning
Custom Resource Name or ID Select the type of custom resource to query from a list or specify its ID via an expression.
Custom Resource ID The unique identifier of the specific resource record to retrieve. This field is required.
Options → Fields to Include Choose one or more fields of the resource to include in the output. You can select from a list or specify IDs using expressions.

Output

The node outputs JSON data representing the retrieved resource record. The structure of the JSON corresponds to the fields requested in the "Fields to Include" property. If no fields are specified, it likely returns the default set of fields for that resource.

If the resource contains binary data fields, those would be included in the output as binary attachments, but this is not explicitly indicated in the provided code or properties.

Dependencies

  • The node depends on dynamic loading methods (getModels and getModelFields) to populate options for resource names and fields. These methods are part of the node's internal logic (likely implemented in the bundled dependencies).
  • Requires access to the backend or API that manages these custom resources.
  • Proper authentication credentials (e.g., an API key or token) must be configured in n8n to authorize requests to the external service managing the custom resources.

Troubleshooting

  • Missing or invalid Custom Resource ID: Since the ID is required, leaving it empty or providing an incorrect ID will cause errors or no data returned.
  • Incorrect resource name or unavailable resource: Selecting a resource that does not exist or is not accessible will result in failure to fetch data.
  • Field selection issues: Specifying fields that do not exist for the chosen resource may lead to incomplete data or errors.
  • Authentication failures: Ensure that the API credentials are correctly set up and have sufficient permissions to read the resource.
  • Dynamic option loading failures: If the dropdowns for resource names or fields fail to load, check network connectivity and API availability.

Links and References

Discussion