Odoo icon

Odoo

Consume Odoo API

Opportunity → Update

AI-generated

Overview

This node updates an existing Opportunity record in Odoo via its API. It is useful for automating CRM workflows, such as updating opportunity details when a lead progresses through a sales pipeline or when new information becomes available. For example, you might use this node to update the expected revenue, probability, or internal notes of an opportunity after a sales call.

Properties

Name Meaning
Opportunity ID The unique identifier of the Opportunity record to update. This is required.
Update Fields A collection of fields to update on the Opportunity. You can add one or more of the following:
- Email: Email address associated with the opportunity.
- Expected Revenue: Numeric value for expected revenue.
- Internal Notes: Free-text notes.
- Name: Name/title of the opportunity.
- Phone: Phone number.
- Priority: Priority level (options: 1, 2, 3).
- Probability: Probability percentage (0–100).

Output

  • The output is a JSON object representing the updated Opportunity record as returned by the Odoo API.
  • If the update is successful, the output contains the updated fields and their values.
  • In case of error and if "Continue On Fail" is enabled, the output will contain an error field with the error message.

Example output:

{
  "id": 123,
  "name": "Updated Opportunity",
  "expected_revenue": 5000,
  "probability": 80,
  "priority": "2"
}

or, on error (if "Continue On Fail" is enabled):

{
  "error": "Opportunity not found"
}

Dependencies

  • Odoo instance: Requires access to an Odoo server with API enabled.
  • Credentials: Needs an n8n credential of type odooApi with URL, username, password, and database name.
  • n8n configuration: No special environment variables beyond credentials are needed.

Troubleshooting

  • Invalid Credentials:
    Error: Credentials are not valid
    Solution: Double-check your Odoo URL, username, password, and database name in the n8n credentials.

  • Opportunity Not Found:
    Error: Opportunity not found
    Solution: Ensure the provided Opportunity ID exists in Odoo.

  • Missing Required Field:
    Error: Missing required parameter: Opportunity ID
    Solution: Make sure to provide a valid Opportunity ID.

  • Field Value Errors:
    Error: e.g., Probability must be between 0 and 100
    Solution: Check that all field values meet Odoo's requirements (e.g., correct data types and ranges).

Links and References

Discussion