Actions21
Custom Resource → Get Many
AI-generatedOverview
The Odoo node for n8n allows you to interact with custom resources in your Odoo instance. Specifically, the Custom Resource → Get Many operation retrieves multiple records from a user-specified Odoo model (custom resource), supporting advanced filtering and field selection. This is useful for automating data extraction, reporting, or integrating Odoo data with other systems.
Common scenarios:
- Fetching all or a subset of records from a custom Odoo model for further processing.
- Filtering records based on specific criteria (e.g., status, date range).
- Selecting only relevant fields to optimize data transfer and processing.
Practical examples:
- Retrieve all sales orders created in the last month.
- Get a list of custom product attributes for synchronization with another system.
- Extract customer records with specific tags or properties.
Properties
| Name | Meaning |
|---|---|
| Custom Resource Name or ID | Select the Odoo model (custom resource) to query. You can choose from a list or specify an ID using an expression. |
| Return All | Whether to return all results or limit the number of returned records. If disabled, the "Limit" property determines the maximum number of results. |
| Limit | Maximum number of results to return (1–1000). Only shown if "Return All" is set to false. |
| Options | Additional options for the request: • Fields to Include: Select which fields to include in the output. Choose from a list or specify IDs using an expression. |
| Filters | Apply one or more filters to narrow down the results. Each filter consists of: • Field Name or ID: The field to filter by. • Operator: One of !=, <, <=, =, >, >=, Child Of, In, Like, Not In.• Value: The value to compare against. |
Output
- The output is an array of JSON objects, each representing a record from the selected custom resource/model.
- The structure of each object depends on the fields included via the "Fields to Include" option. By default, all standard fields are returned unless limited.
- Example output (fields will vary depending on your model and selection):
[
{
"id": 123,
"name": "Sample Record",
"status": "active",
"created_at": "2024-06-01T12:00:00Z"
},
...
]
- If an error occurs and "Continue On Fail" is enabled, the output item will contain an
errorfield with the error message.
Dependencies
- Odoo API: Requires access to an Odoo instance with API credentials (URL, database name, username, password).
- n8n Credentials: You must configure Odoo API credentials in n8n under the name
odooApi.
Troubleshooting
Common issues:
- Invalid credentials: If authentication fails, ensure your Odoo URL, database, username, and password are correct.
- Model or field not found: If you specify a custom resource or field that does not exist, the node may throw an error indicating the model/field is invalid.
- Filter errors: Using incorrect operators or values in filters may result in no data or errors from Odoo.
Error messages:
"Credentials are not valid": Check your Odoo API credentials."Settings are not valid: ...": There may be a misconfiguration in your connection settings."error": "<message>"in output: Indicates a runtime error for a particular input item; review the message for details.