Odoo icon

Odoo

Consume Odoo API

Overview

The Odoo Opportunity - Get Many operation retrieves multiple opportunity records from an Odoo instance. This node is useful for automating the extraction of sales opportunities, leads, or pipeline data from Odoo for reporting, synchronization, or further processing in your workflows.

Common scenarios:

  • Exporting all or a filtered set of opportunities to another system (e.g., CRM, spreadsheet).
  • Generating reports or dashboards based on Odoo opportunity data.
  • Synchronizing Odoo opportunities with other business tools.

Example:
You can use this node to fetch all opportunities assigned to a specific salesperson, or retrieve only certain fields (like name, stage, expected revenue) for each opportunity.


Properties

Name Meaning
Return All Whether to return all results or only up to a given limit. If enabled, all matching opportunities are returned; if disabled, you can specify a maximum number using "Limit".
Limit Max number of results to return. Only shown if "Return All" is false. Accepts values between 1 and 1000.
Options Additional options for the request:
- Fields to Include: Select which fields to include in the output. You can choose from a list or specify field IDs using an expression.

Output

  • The output is an array of JSON objects, each representing an Odoo opportunity.
  • Each object contains the fields specified in "Fields to Include" (or all default fields if none are specified).
  • Example output structure:
[
  {
    "id": 123,
    "name": "Big Deal",
    "stage_id": [4, "Qualified"],
    "expected_revenue": 50000,
    "...": "other selected fields"
  },
  {
    "id": 124,
    "name": "Small Lead",
    "stage_id": [2, "New"],
    "expected_revenue": 2000
  }
]
  • If an error occurs and "Continue On Fail" is enabled, the output will contain an error property with the error message for the failed item.

Dependencies

  • Odoo API: Requires access to an Odoo instance with valid credentials (URL, username, password, database name).
  • n8n Credentials: You must configure Odoo API credentials in n8n under the name odooApi.

Troubleshooting

Common issues:

  • Invalid credentials: If authentication fails, ensure the URL, username, password, and database name are correct.
  • Field selection errors: Specifying non-existent fields in "Fields to Include" may result in errors or missing data.
  • API limits: Large datasets may be slow to retrieve if "Return All" is enabled and there are many opportunities.

Error messages:

  • "Credentials are not valid": Check your Odoo credentials.
  • "Settings are not valid: ...": There may be a misconfiguration in the connection settings.
  • "error": "<message>" in output: Indicates a per-item failure when "Continue On Fail" is enabled.

Links and References

Discussion