# Example: Sales Order Management
## Create a Sales Order
```json
{
"tool": "odoo_create",
"arguments": {
"model": "sale.order",
"values": {
"partner_id": 14,
"date_order": "2025-12-09",
"order_line": [
[
0,
0,
{
"product_id": 25,
"product_uom_qty": 5,
"price_unit": 100.0
}
],
[
0,
0,
{
"product_id": 26,
"product_uom_qty": 2,
"price_unit": 250.0
}
]
]
}
}
}
```
## Find Draft Sales Orders
```json
{
"tool": "odoo_search_read",
"arguments": {
"model": "sale.order",
"domain": [["state", "=", "draft"]],
"fields": ["name", "partner_id", "date_order", "amount_total"],
"order": "date_order DESC",
"limit": 10
}
}
```
## Confirm a Sales Order
```json
{
"tool": "odoo_execute",
"arguments": {
"model": "sale.order",
"method": "action_confirm",
"args": [[123]]
}
}
```
## Get Sales Order Lines
```json
{
"tool": "odoo_search_read",
"arguments": {
"model": "sale.order.line",
"domain": [["order_id", "=", 123]],
"fields": ["product_id", "product_uom_qty", "price_unit", "price_subtotal"]
}
}
```
## Update Order Line Quantity
```json
{
"tool": "odoo_write",
"arguments": {
"model": "sale.order.line",
"ids": [456],
"values": {
"product_uom_qty": 10
}
}
}
```
## Cancel a Sales Order
```json
{
"tool": "odoo_execute",
"arguments": {
"model": "sale.order",
"method": "action_cancel",
"args": [[123]]
}
}
```
## Get Order Statistics
```json
{
"tool": "odoo_execute",
"arguments": {
"model": "sale.order",
"method": "read_group",
"args": [
[["state", "in", ["sale", "done"]]],
["amount_total", "partner_id"],
["partner_id"]
],
"kwargs": {
"orderby": "amount_total DESC",
"limit": 10
}
}
}
```