Odoo icon

Odoo

Consume Odoo API

Overview

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 modules or tables that are not covered by standard resources like Contacts or Opportunities.

Common use cases:

  • Automating data entry into custom Odoo models from other systems.
  • Integrating external forms or applications with Odoo's custom resources.
  • Bulk importing data into custom tables via n8n workflows.

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 a new item is 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 includes:
- Field Name or ID: Choose the field to set (from a list or by specifying its technical name).
- New Value: The value to assign.

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 your custom Odoo model and the values you provided. Typically, it will include at least the record's ID 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 contain 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 model.
  • Credentials: You must configure Odoo API credentials (odooApi) in n8n, including URL, database name, username, and password.

Troubleshooting

Common issues:

  • Invalid Credentials: If the Odoo credentials are incorrect, you'll receive an authentication error. Double-check the URL, database name, username, and password.
  • Missing Required Fields: If you omit required fields for the custom resource, Odoo will return an error indicating which fields are missing.
  • Incorrect Model or Field Names: Specifying a non-existent model or field will result in errors such as "model not found" or "unknown field".
  • Permissions: The user account used must have permission to create records in the target model.

Error messages:

  • "Credentials are not valid": Check your Odoo credentials.
  • "Settings are not valid: ...": There may be a configuration issue; verify all connection details.
  • "model not found" or similar: Ensure the custom resource name matches the technical name of the Odoo model.

Links and References

Discussion