# Request

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.Odoo/tree/main/Frends.Odoo.Request>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name              | Description                                                                                                                                                                                                                                                             |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Model : `String`  | <p>Model to call in the request. You can get a list of Odoo model by calling the "ir.model" model</p><p>with the "search\_read" method and the fields "name", "model" and "state".</p><p><br>Default: <code>res.partner</code><br>Example: <code>res.partner</code></p> |
| Method : `String` | <p>Method to execute in the request.</p><p><br>Default: <code>search\_read</code><br>Example: <code>res.partner</code></p>                                                                                                                                              |
| Args : `String`   | <p>Method arguments as JSON.</p><p><br>Default: <code>\[]</code><br>Example: <code>\[ "arg1", 1 ]</code></p>                                                                                                                                                            |
| Kwargs : `String` | <p>Method keyword arguments as JSON.</p><p><br>Default: <code>{}</code><br>Example: <code>{ "key1": "value1", "key2": "value2" }</code></p>                                                                                                                             |
| {% endtab %}      |                                                                                                                                                                                                                                                                         |

{% tab title="Parameter: Options" %}

| Name                                      | Description                                                                                                                                                                                                                                               |
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OdooUrl : `String`                        | <p>Odoo URL.</p><p><br>Default: <code><https://example.com></code><br>Example: <code><https://example.com></code></p>                                                                                                                                     |
| Username : `String`                       | <p>Username to authenticate with.</p><p><br>Default: <code><john.doe@example.com></code><br>Example: <code><john.doe@example.com></code></p>                                                                                                              |
| 🗝Password : `String`                     | <p>Password to authenticate with.</p><p><br>Default: <code>-</code><br>Example: <code>Password!</code></p>                                                                                                                                                |
| Database : `String`                       | <p>Odoo database.</p><p><br>Default: <code>MyDatabase</code><br>Example: <code>MyDatabase</code></p>                                                                                                                                                      |
| ThrowExceptionOnErrorResponse : `Boolean` | <p>If true, the task throws an exception if the response from Odoo contains an error.</p><p>If false, the task returns the error message in the result.</p><p><br>Default: <code>False</code><br>Example: <code>Example of the parameter value</code></p> |
| {% endtab %}                              |                                                                                                                                                                                                                                                           |

{% tab title="Result: Result" %}

| Name                | Description                                                                                                                                                                                                                                             |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success : `Boolean` | <p>True if the operation was successful. False if the operation failed. If optional parameter ThrowExceptionOnErrorResponse is set to true, the task throws an exception if the response from Odoo contains an error.<br>Example: <code>true</code></p> |
| Error : `String`    | <p>Error message if the operation failed.<br>Example: <code>Error message</code></p>                                                                                                                                                                    |
| Data : `Object`     | <p>Data returned by the operation in JToken format. You can use dot notation to access the field values.<br>Example: <code>\[ { "field1": "value1" }, { "field1": "value2" } ]</code></p>                                                               |
| {% endtab %}        |                                                                                                                                                                                                                                                         |

{% tab title="Changelog" %}

## Changelog

### \[1.1.0] - 2024-08-23

#### Changed

* Updated the Newtonsoft.Json package to version 13.0.3.

### \[1.0.0] - 2024-05-30

#### Changed

* Initial implementation of Frends.Odoo.Request
  {% endtab %}
  {% endtabs %}
