Query Odoo ERP system via XML-RPC API.

This task interacts with Odoo models using XML-RPC API. It supports various operations like search_read, create, write, unlink, search, and search_count. You can configure the Odoo server connection and specify the model, operation, and parameters.

yaml
type: "io.kestra.plugin.odoo.Query"

Search and read company partners.

yaml
id: odoo_query_partners
namespace: company.team

tasks:
  - id: query_partners
    type: io.kestra.plugin.odoo.Query
    url: http://localhost:8069
    db: demo
    username: test@demo.com
    password: "{{ secret('ODOO_PASSWORD') }}"
    model: res.partner
    operation: SEARCH_READ
    filters:
      - ["is_company", "=", true]
    fields: ["name", "email", "phone", "is_company"]
    limit: 10
    fetchType: FETCH

Create a new partner.

yaml
id: create_partner
namespace: company.team

tasks:
  - id: create_partner
    type: io.kestra.plugin.odoo.Query
    url: http://localhost:8069
    db: demo
    username: test@demo.com
    password: "{{ secret('ODOO_PASSWORD') }}"
    model: res.partner
    operation: CREATE
    values:
      name: "Acme Corporation"
      email: "contact@acme.com"
      is_company: true

Update existing partners.

yaml
id: update_partners
namespace: company.team

tasks:
  - id: update_partners
    type: io.kestra.plugin.odoo.Query
    url: http://localhost:8069
    db: demo
    username: test@demo.com
    password: "{{ secret('ODOO_PASSWORD') }}"
    model: res.partner
    operation: WRITE
    ids: [1, 2, 3]
    values:
      active: true
      category_id: [[6, 0, [1, 2]]]
Properties

Database name

The name of the Odoo database to connect to

Model name

The Odoo model to operate on (e.g., 'res.partner', 'sale.order', 'product.product')

Possible Values
SEARCH_READREADCREATEWRITEUNLINKSEARCHSEARCH_COUNT

Operation

The operation to perform on the model

Password

Odoo password for authentication

Odoo server URL

The base URL of your Odoo instance (e.g., https://my-odoo-instance.com)

Username

Odoo username for authentication

Default NONE
Possible Values
STOREFETCHFETCH_ONENONE

Fetch type

How to handle query results. STORE: store all rows to a file, FETCH: output all rows as output variable, FETCH_ONE: output the first row, NONE: do nothing (default for non-read operations)

SubType string

Fields to retrieve

List of field names to retrieve in search_read operations. If not specified, all fields are returned.

Search filters

Domain filters for search operations. Each filter is a list of field, operator, value. Multiple filters are combined with AND logic. Example: [["is_company", "=", true], "customer_rank", ">", 0]

SubType integer

Record IDs

List of record IDs for write/unlink operations

Limit

Maximum number of records to return (for search operations)

Offset

Number of records to skip (for search operations)

Values

Field values for create/write operations. Map of field names to values.

SubType integer

List of IDs for CREATE operations or affected record IDs

Contains the IDs of created records (CREATE) or affected records (WRITE/UNLINK).

Map containing the first row of fetched data

Only populated if fetchType is FETCH_ONE.

SubType object

List of map containing rows of fetched data

Only populated if fetchType is FETCH.

The number of records affected or returned by the operation

Format uri

The URI of the result file on Kestra's internal storage (.ion file / Amazon Ion formatted text file)

Only populated if fetchType is STORE.