Odoo icon

Odoo

Consume Odoo API

Custom Resource → Action

AI-generated

Overview

This n8n node allows you to interact with custom resources in an Odoo instance via its API. Specifically, for the "Custom Resource" resource and the "Action" operation, the node enables you to trigger a specific action on a custom Odoo model (resource) by providing the resource's ID and the name of the action to perform. This is useful when you need to automate or integrate Odoo workflows that involve custom business logic encapsulated as server-side actions.

Common scenarios:

  • Automating workflow steps that require triggering custom server actions on Odoo records.
  • Integrating external systems with Odoo by programmatically invoking custom logic (e.g., validation, state transitions, notifications).
  • Batch processing or orchestrating complex business processes involving custom Odoo models.

Example:
You have a custom Odoo model called x_my_custom_model and want to trigger a custom server action named do_special_thing on a record with ID 123. This node can be configured to perform that action automatically as part of your n8n workflow.


Properties

Name Meaning
Custom Resource Name or ID Choose the Odoo model (custom resource) to operate on. You can select from a list or specify the technical model name using an expression.
Custom Resource ID The unique identifier (ID) of the record in the selected custom resource on which to perform the action.
Action to Perform The technical name of the action to execute on the specified record.

Output

The output will be a JSON object containing the result of the triggered action. The structure of this output depends on what the Odoo action returns, which may vary based on your Odoo configuration and the specific action invoked. Typically, it could be:

  • A status message
  • Updated record data
  • Any data returned by the custom action

If an error occurs, and "Continue On Fail" is enabled, the output will include an error field with the error message.

Example output:

{
  "result": "Action executed successfully"
}

or, in case of error:

{
  "error": "Action not found on the specified model"
}

Dependencies

  • Odoo Instance: You must have access to an Odoo server with the relevant custom model and action defined.
  • API Credentials: Requires valid Odoo API credentials (odooApi) including URL, database name, username, and password.
  • n8n Configuration: The node must be configured with the correct credentials in n8n.

Troubleshooting

Common issues:

  • Invalid Model or Action Name: If the model or action name is incorrect, Odoo will return an error such as "Action not found on the specified model".
    • Resolution: Double-check the technical names in Odoo for both the model and the action.
  • Authentication Errors: If credentials are invalid, you'll see errors like "Credentials are not valid".
    • Resolution: Verify your Odoo API credentials in n8n.
  • Missing Record: If the provided Custom Resource ID does not exist, Odoo may return a "Record not found" error.
    • Resolution: Ensure the record exists in Odoo before running the node.
  • Insufficient Permissions: The user account used may lack permissions to perform the action.
    • Resolution: Check user roles and access rights in Odoo.

Links and References


Discussion