Odoo icon

Odoo

Consume Odoo API

Overview

This node allows you to delete an "Opportunity" record in Odoo via its API. It is useful for automating the removal of sales opportunities from your Odoo CRM, for example, when an opportunity is no longer relevant or was created by mistake. Typical scenarios include cleaning up outdated leads or integrating with other systems that require automated opportunity management.

Example use cases:

  • Automatically remove opportunities that have been marked as lost in another system.
  • Clean up test or duplicate opportunities during data migration or synchronization processes.

Properties

Name Meaning
Opportunity ID The unique identifier of the Opportunity record to be deleted. This field is required.

Output

  • The output will be a JSON object indicating the result of the deletion operation. Typically, this may be a confirmation (such as a boolean or status message) or an error message if the operation fails.
  • If an error occurs and "Continue On Fail" is enabled, the output will contain an error field with the error message.

Example success output:

[
  {
    "success": true
  }
]

Example error output (with Continue On Fail):

[
  {
    "error": "Record not found"
  }
]

Dependencies

  • Odoo instance: You must have access to an Odoo server with the appropriate permissions to delete opportunities.
  • n8n Credentials: The node requires valid Odoo API credentials (odooApi) configured in n8n, including:
    • URL
    • Username
    • Password
    • Database name (if applicable)

Troubleshooting

Common issues:

  • Invalid Opportunity ID: If the provided Opportunity ID does not exist, the node will return an error such as "Record not found".
  • Authentication errors: If the Odoo credentials are incorrect or lack permission, you may see errors like "Credentials are not valid" or "Authentication failed".
  • Connection issues: Network problems or incorrect Odoo URL can cause connection errors.

How to resolve:

  • Double-check the Opportunity ID for accuracy.
  • Ensure your Odoo credentials are correct and have sufficient permissions.
  • Verify the Odoo server URL and network connectivity.

Links and References

Discussion