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, the "Call Method" operation for a Custom Resource enables you to invoke any method on a specified Odoo model (custom resource) and pass record IDs as arguments. This is useful when you need to trigger server-side logic or workflows defined in your Odoo instance, such as confirming sales orders, sending emails, or running custom business logic.

Practical examples:

  • Triggering a custom workflow on selected records in a custom Odoo module.
  • Calling standard or custom methods (e.g., action_confirm, send_email) on one or more records by their IDs.
  • Automating complex Odoo operations that are not covered by basic CRUD actions.

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 using an expression.
Method Name string The name of the method to call on the selected Odoo model. Required.
Record IDs string Comma-separated list of record IDs on which to call the specified method.

Output

  • The output will be a JSON array containing the result(s) returned by the called Odoo method for the specified records.
  • The structure of each item in the output array depends on the method being called and the Odoo model's response. Typically, it may include fields such as status, result data, or error messages if the method execution fails.
  • If an error occurs and "Continue On Fail" is enabled, the output will contain an object with an error field describing the issue.

Example output:

[
  {
    "result": "success"
  }
]

or, in case of error:

[
  {
    "error": "Method not found on model"
  }
]

Dependencies

  • Odoo API: Requires access to an Odoo instance with the appropriate models and methods available.
  • Credentials: An Odoo API credential (username, password, database, URL) must be configured in n8n under the name odooApi.
  • n8n Configuration: No additional configuration required beyond credentials.

Troubleshooting

Common issues:

  • Invalid Model or Method Name: If the model or method does not exist in Odoo, you may receive errors like "Method not found on model" or similar.
  • Incorrect Record IDs: Providing non-existent or malformed record IDs will cause the method call to fail.
  • Authentication Errors: Invalid credentials will prevent the node from connecting to Odoo.
  • Permission Denied: The Odoo user may lack permissions to call certain methods or access specific records.

Error messages and resolutions:

  • "Credentials are not valid": Check your Odoo API credentials in n8n.
  • "Method not found on model": Verify the method name and ensure it exists on the selected model in Odoo.
  • "Record not found": Ensure the provided record IDs are correct and exist in Odoo.
  • "Settings are not valid: ...": Review your Odoo connection settings (URL, database, username, password).

Links and References

Discussion