odoo_stock_mo_delete_draft
Delete draft or cancelled manufacturing orders with cascade, bypassing Odoo's deletion constraint. Refuses if stock moves have positive quantity or order is done. Use dry-run first.
Instructions
Safely DELETE a draft or cancelled mrp.production with cascade (raw stock.moves, finished stock.moves, procurement.group if orphaned). Bypasses Odoo's ORM 'cannot be deleted' constraint by forcing state='cancel' via raw SQL, then using DELETE statements inside an ir.actions.server. Refuses if MO has any SVL, stock.move with quantity > 0, or an already-done state. ALWAYS use dry_run=true first.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"mo_id": "<mo_id>"
},
"name": "odoo_stock_mo_delete_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mo_id | Yes | mrp.production ID to delete | |
| dry_run | No | If true, only preview (no writes). | |
| connection | No | default |