Odoo¶
flowtask.components.Odoo
¶
Odoo
¶
Bases: HTTPService, FlowComponent
Odoo
Overview
This component interacts with an Odoo server to perform various operations like `search_read` and `create`.
.. table:: Properties
:widths: auto
+------------------------------+----------+-----------+---------------------------------------------------------+
| Name | Required | Summary |
+------------------------------+----------+-----------+---------------------------------------------------------+
| credentials | Yes | A dictionary containing connection details to the Odoo server: |
| | | "HOST", "PORT", "DB", "USERNAME", "PASSWORD". |
+------------------------------+----------+-----------+---------------------------------------------------------+
| method | Yes | The Odoo method to be called (e.g., "search_read", "create"). |
+------------------------------+----------+-----------+---------------------------------------------------------+
| model | Yes | The Odoo model to be used for the method call (e.g., "res.partner").|
+------------------------------+----------+-----------+---------------------------------------------------------+
| domain | No | Domain filter for searching records, applicable for "search_read". |
+------------------------------+----------+-----------+---------------------------------------------------------+
| fields | No | Fields to be retrieved, applicable for "search_read". |
+------------------------------+----------+-----------+---------------------------------------------------------+
| values | No | Values to be used for creating records, applicable for "create". |
+------------------------------+----------+-----------+---------------------------------------------------------+
| use_field_from_previous_step | No | Field from previous step to filter records in "search_read". |
+------------------------------+----------+-----------+---------------------------------------------------------+
Returns
This component returns a pandas DataFrame containing the results of the Odoo operation.
Example:
```yaml
Odoo:
credentials:
HOST: ODOO_HOST
PORT: ODOO_PORT
DB: ODOO_DB
USERNAME: ODOO_USERNAME
PASSWORD: ODOO_PASSWORD
model: stock.warehouse
method: search_read
domain:
- - - company_id.name
- '='
- Pokemon
fields:
- id
```