Actions21
Custom Resource → Create
AI-generatedOverview
This node allows you to create a new record in a custom resource (model) within an Odoo instance. It is designed for scenarios where you need to automate the creation of records in any custom model available in your Odoo system, such as custom business objects or extensions beyond standard Odoo modules.
Common use cases:
- Automating the addition of entries to custom tables/models in Odoo.
- Integrating external data sources with custom Odoo models.
- Building workflows that require dynamic interaction with various Odoo resources not covered by default nodes.
Example:
Suppose you have a custom model in Odoo for managing equipment inventory. You can use this node to automatically add new equipment records whenever new items are registered in another system.
Properties
| Name | Meaning |
|---|---|
| Custom Resource Name or ID | Select the target custom resource (Odoo model) from a list, or specify its technical name using an expression. |
| Fields | Add one or more fields to set on the new record. Each field consists of: • Field Name or ID: Choose the field to set (from a list or by specifying its technical name via expression). • New Value: The value to assign to the field. |
Output
The output will be a JSON object representing the newly created record in the specified custom resource. The structure of the output depends on the fields defined in the custom resource and the values provided. Typically, it includes at least the record's unique identifier and any fields you set during creation.
Example output:
{
"id": 123,
"field1": "value1",
"field2": "value2"
}
If an error occurs and "Continue On Fail" is enabled, the output will include an error property with the error message.
Dependencies
- Odoo API: Requires access to an Odoo instance with the appropriate permissions to create records in the selected custom resource.
- Credentials: You must configure Odoo API credentials (
odooApi) in n8n, including URL, database name, username, and password.
Troubleshooting
Common issues:
- Invalid Credentials: If authentication fails, ensure your Odoo credentials (URL, DB, username, password) are correct and the user has sufficient rights.
- Model or Field Not Found: If the specified custom resource or field does not exist, verify the technical names and that the model is available in your Odoo instance.
- Missing Required Fields: Odoo may reject the creation if required fields are not provided. Check your custom model's requirements.
- Error Handling: If "Continue On Fail" is enabled, errors will appear in the output under an
errorkey; otherwise, the workflow will stop on error.
Typical error messages:
"Credentials are not valid": Check your Odoo API credentials."Settings are not valid: ...": There may be a misconfiguration in the connection settings."Model not found"or"Field not found": Double-check the resource and field names/IDs.