Odoo Enhanced (PR15676) icon

Odoo Enhanced (PR15676)

Consume Odoo API with enhanced features from PR #15676

Actions6

Overview

This custom node is designed to create records in a user-defined "Custom Resource" within an external system. It allows users to specify the resource by name or ID and define multiple fields with their corresponding values to be created or updated in that resource. This node is beneficial when you need to programmatically add new entries to a flexible data model, such as creating new items in a custom database table or adding records to a bespoke API endpoint.

Practical examples include:

  • Creating a new customer record in a custom CRM module.
  • Adding a new product entry in a tailored inventory management system.
  • Inserting a new configuration or settings record into a custom application resource.

Properties

Name Meaning
Custom Resource Name or ID Select the target custom resource from a list or specify its ID via an expression. This determines where the new record will be created.
Fields Define one or more fields to set on the new record. Each field requires:
- Field Name or ID: Choose from available fields or specify via expression.
- New Value: The value to assign to the field in the new record. Multiple fields can be added.

Output

The node outputs JSON data representing the newly created record in the custom resource. This output typically includes all fields of the created record, reflecting the values after creation. If the external system supports binary data for this resource, it would be included accordingly, but based on the provided code and properties, the primary output is structured JSON data of the created entity.

Dependencies

  • Requires connection to an external system that exposes custom resources and supports record creation via API.
  • Needs an API authentication token or key configured in n8n credentials to authorize requests.
  • Utilizes dynamic loading methods (getModels and getModelFields) to populate selectable options for resources and fields, implying the node fetches metadata from the external system at runtime.

Troubleshooting

  • Issue: Unable to load custom resources or fields in dropdowns.
    Cause: Authentication failure or connectivity issues with the external system.
    Resolution: Verify API credentials and network access; ensure the external system is reachable.

  • Issue: Creation fails with validation errors.
    Cause: Required fields missing or invalid field values.
    Resolution: Check the required fields for the selected resource and ensure all mandatory fields are provided with valid data types.

  • Issue: Node returns empty or incomplete output.
    Cause: The external system may not return the full created record or there might be an error in parsing the response.
    Resolution: Review API documentation for the resource's create operation and verify the node's response handling.

Links and References

  • n8n Expressions Documentation — For using expressions in property values.
  • External system API documentation (not provided) — Consult for details on custom resource structure and creation endpoints.

Discussion