Tameson Odoo icon

Tameson Odoo

Consume Odoo API

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 model in your Odoo instance.

Common scenarios:

  • Automating cleanup of obsolete or test data in custom Odoo models.
  • Integrating Odoo with other systems where deletion of records is triggered externally.
  • Building workflows that manage the lifecycle of custom business objects in Odoo.

Example:
You have a custom model called x_my_custom_model in Odoo, and you want to automatically delete certain records based on external triggers or conditions managed 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 (ID) of the record in the selected custom resource/model that you want to delete.

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 vary depending on the response from Odoo and the implementation of the helper functions.


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 or Record Not Found: If the specified custom resource or record ID does not exist, you may receive errors such as "Record not found".
  • Insufficient Permissions: The Odoo user must have permission to delete records from the specified model; otherwise, the operation will fail.
  • Incorrect Model Name: Ensure the model name provided matches exactly the technical name in Odoo (e.g., x_my_custom_model).

How to resolve:

  • Double-check your Odoo credentials and permissions.
  • Verify the model name and record ID exist in your Odoo instance.
  • Check for typos or incorrect expressions in property values.

Links and References

Discussion