Odoo icon

Odoo

Consume Odoo API

Custom Resource → Update

AI-generated

Overview

The Odoo node for n8n allows you to interact with custom resources in your Odoo instance. Specifically, the Update operation for a Custom Resource enables you to update fields of any custom model (resource) by specifying its name or ID and providing new values for one or more fields. This is useful when you need to automate updates to custom records in Odoo, such as updating statuses, custom attributes, or other data points unique to your business processes.

Practical examples:

  • Automatically update a custom "Project" record's status when a related workflow step completes.
  • Change values in a custom "Subscription" model based on external triggers.
  • Update multiple fields of a custom resource in bulk from another system.

Properties

Name Meaning
Custom Resource Name or ID Select the custom Odoo model to update. You can choose from a list or specify the model's technical name using an expression.
Custom Resource ID The unique identifier of the specific record in the selected custom resource that you want to update. This field is required.
Update Fields One or more fields to update on the selected record. For each field:
- Field Name or ID: Choose the field to update (from a list or via expression).
- New Value: The new value to set for this field.

Output

  • The output will be a JSON object representing the updated custom resource record as returned by the Odoo API after the update operation.
  • If multiple items are processed, the output will be an array of such objects.
  • In case of error and if "Continue On Fail" is enabled, the output will include an error property with the error message for failed items.

Example output:

{
  "id": 123,
  "field1": "new value",
  "field2": 42,
  ...
}

Dependencies

  • Odoo API: Requires access to an Odoo instance with the appropriate models and permissions.
  • Credentials: You must configure Odoo API credentials in n8n (odooApi), including:
    • URL of your Odoo instance
    • Database name
    • Username
    • Password

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 model or field that does not exist, the node will throw an error. Double-check the technical names.
  • Missing Required Fields: If required fields are not provided, Odoo may reject the update.
  • Permission Denied: Ensure the user has write access to the specified model and record.

Error messages:

  • "Credentials are not valid": Check your Odoo credentials.
  • "Settings are not valid: ...": There may be a misconfiguration in the node or credentials.
  • "error": "<message>" in output: Indicates a problem with the update request (e.g., invalid field, missing record).

Links and References

Discussion