create_record
Create an Odoo record and avoid duplicates by specifying unique field names to search for an existing match, returning the existing record instead of creating a new one.
Instructions
Create a record, reusing an existing match when unique_on is given.
unique_on is a list of FIELD NAMES taken from values (e.g.
["name", "email"]): they are searched first and the existing id comes
back instead of a duplicate. Odoo has no idempotency key, so a create that
is retried is simply a second record — this is the only protection there
is, and a cold-start run without it produced four identical customers.
Multi-company: put company_id in values. The context decides what is
visible, not which company owns the new record.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | ||
| values | Yes | ||
| unique_on | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |