ppm_milestone_cancel
Cancel a milestone by providing its unique ID. This tool triggers the workflow action to stop the milestone's progress.
Instructions
Cancel a milestone.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| milestone_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/qod_ppm_mcp/server.py:65-69 (handler)The MCP tool handler that cancels a milestone by calling the Odoo action_cancel method on ppm.milestone, then reads back the updated state.
@mcp.tool() def ppm_milestone_cancel(milestone_id: int) -> dict[str, Any]: """Cancel a milestone.""" client().call_action("ppm.milestone", "action_cancel", [milestone_id]) return _read_state("ppm.milestone", milestone_id, _MILESTONE_FIELDS) - src/qod_ppm_mcp/server.py:41-41 (schema)Schema/fields definition used to read milestone state after the cancel action.
_MILESTONE_FIELDS = ["name", "state", "date_planned", "date_actual", "project_id"] - src/qod_ppm_mcp/server.py:65-66 (registration)The @mcp.tool() decorator registers this function as an MCP tool named ppm_milestone_cancel.
@mcp.tool() def ppm_milestone_cancel(milestone_id: int) -> dict[str, Any]: - src/qod_ppm_mcp/server.py:23-27 (helper)Helper function that returns the singleton OdooClient instance used by the handler.
def client() -> OdooClient: global _client if _client is None: _client = OdooClient.from_env() return _client - src/qod_ppm_mcp/server.py:30-34 (helper)Helper that reads and returns the record's current state after the cancel action.
def _read_state(model: str, rec_id: int, fields: list[str]) -> dict[str, Any]: rows = client().read(model, [rec_id], fields) if not rows: raise ValueError(f"{model} id={rec_id} not found") return rows[0]