Odoo icon

Odoo

Consume Odoo API

Overview

The Odoo Opportunity Create operation node allows you to create a new opportunity record in your Odoo CRM system directly from an n8n workflow. This is useful for automating lead management, sales pipeline updates, or integrating external systems (like web forms or marketing tools) with your Odoo CRM. For example, you could automatically create an opportunity when a new lead is captured on your website.

Properties

Name Meaning
Name The name of the opportunity. This is a required field and typically represents the title or subject of the opportunity.
Additional Fields A collection of optional fields to further describe the opportunity:
Email: Email address associated with the opportunity.
Expected Revenue: Anticipated revenue amount.
Internal Notes: Any notes or description.
Phone: Phone number related to the opportunity.
Priority: Priority level; options are 1, 2, or 3.
Probability: Probability of closing the opportunity (0–100).

Output

  • The output will be a JSON object representing the newly created opportunity as returned by the Odoo API.
  • The structure typically includes all fields sent in the request, plus any additional fields populated by Odoo (such as unique ID, timestamps, etc.).
  • Example output:
{
  "id": 123,
  "name": "New Business Deal",
  "email_from": "[email protected]",
  "expected_revenue": 5000,
  "description": "Initial contact made.",
  "phone": "+1234567890",
  "priority": "2",
  "probability": 75,
  ...
}
  • If an error occurs and "Continue On Fail" is enabled, the output will include an error field with the error message.

Dependencies

  • Odoo instance: You must have access to an Odoo server with the CRM module enabled.
  • API Credentials: Requires valid Odoo API credentials (url, username, password, and optionally db).
  • n8n Credentials: Set up an "odooApi" credential in n8n.

Troubleshooting

  • Invalid Credentials: If authentication fails, you'll see errors like Credentials are not valid. Double-check your Odoo URL, username, password, and database name.
  • Missing Required Field: If the "Name" property is missing, the node will throw an error indicating that a required parameter is missing.
  • Field Value Errors: If you provide invalid values (e.g., probability outside 0–100), Odoo may reject the request.
  • Connection Issues: Network or server issues can result in timeout or connection errors.

Links and References

Discussion