Actions20
Overview
This node allows you to interact with custom resources in an Odoo system from n8n. Specifically, when using the Custom Resource resource and the Delete operation, the node deletes a record from a user-specified Odoo model (custom resource) by its ID. This is useful for automating the removal of records from any custom table or module in your Odoo instance.
Common scenarios:
- Automating cleanup tasks by deleting obsolete or test records from custom Odoo models.
- Integrating external systems that require deletion of specific entries in Odoo based on business logic.
- Building workflows where data consistency requires removing related records from Odoo.
Example:
You have a custom model in Odoo called x_my_custom_model and want to delete a record with a specific ID as part of an automated process in n8n.
Properties
| Name | Type | Meaning |
|---|---|---|
| Custom Resource Name or ID | options | Select the Odoo model (custom resource) to operate on. You can choose from a list or specify the model name directly using an expression. |
| Custom Resource ID | string | The unique identifier of the record in the selected custom resource/model that you want to delete. This field is required for the Delete action. |
Output
The output will be a JSON object indicating the result of the delete operation. Typically, this will include confirmation of deletion or an error message if the operation failed.
Example output:
[
{
"success": true
}
]
or, in case of failure (if "Continue On Fail" is enabled):
[
{
"error": "Record not found"
}
]
Note: The exact structure may depend on the response from the Odoo API and how errors are handled.
Dependencies
- Odoo API: Requires access to an Odoo instance with the appropriate permissions to delete records from the specified model.
- Credentials: You must configure Odoo API credentials (
odooApi) in n8n, including URL, database name, username, and password.
Troubleshooting
Common issues:
- Invalid Credentials: If the Odoo credentials are incorrect, the node will fail to authenticate. Error messages like "Credentials are not valid" or "Settings are not valid" may appear.
- Model Not Found: If the specified custom resource/model does not exist, you may receive an error such as "model not found".
- Record Not Found: If the provided Custom Resource ID does not correspond to an existing record, the node may return an error like "Record not found".
- Insufficient Permissions: The Odoo user must have permission to delete records from the specified model.
How to resolve:
- Double-check your Odoo credentials and ensure the user has the necessary permissions.
- Verify the model name and record ID are correct.
- Use expressions to dynamically set values if needed.