Actions21
Overview
This node allows you to create a new record in a custom Odoo resource (model) via the Odoo API. It is designed for scenarios where you need to automate the creation of records in any custom model within your Odoo instance, such as adding entries to custom tables or modules that are not covered by standard resources like Contacts or Opportunities.
Practical examples:
- Automatically creating a new entry in a custom "Project Tasks" model when a new task is created in another system.
- Adding data to a custom inventory table from an external source.
- Integrating n8n workflows with bespoke Odoo modules developed for your organization.
Properties
| Name | Type | Meaning |
|---|---|---|
| Custom Resource Name or ID | options | Select the Odoo model (custom resource) to create a record in. You can choose from a list of available models or specify the model name/ID using an expression. |
| Fields | fixedCollection | Specify one or more fields and their values to set on the new record. Each field entry includes: - Field Name or ID: The technical name or ID of the field in the selected model. - New Value: The value to assign to this field. |
Output
The output will be a JSON object representing the newly created record in the specified custom Odoo resource. The structure of this object depends on the fields defined in your custom model and the values you provided. Typically, it will include at least the record's unique identifier (e.g., id) and any other fields returned by the Odoo API upon creation.
Example output:
[
{
"id": 123,
"field1": "value1",
"field2": "value2"
// ...other fields as defined in your custom model
}
]
Dependencies
- Odoo API: Requires access to your Odoo instance's API endpoint.
- Credentials: You must configure Odoo API credentials in n8n (
odooApi), including URL, database name, username, and password.
Troubleshooting
Common issues:
- Invalid credentials: If authentication fails, ensure your Odoo API credentials (URL, DB, username, password) are correct.
- Model or field not found: If you specify a model or field name/ID that does not exist in your Odoo instance, the node will throw an error.
- Missing required fields: If you do not provide all required fields for the custom model, Odoo may reject the creation request.
Error messages:
"Credentials are not valid": Check your Odoo API credentials."Settings are not valid: ...": There may be a configuration issue; verify the Odoo instance URL and database name."error: <message>"in output: Indicates a problem with the data sent to Odoo, such as missing or invalid fields.