ppm_milestone_reopen
Reopen a milestone by resetting its status to 'planned'. Provide the milestone ID to restore it from a completed or cancelled state.
Instructions
Reopen a milestone back to 'planned'.
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:72-76 (handler)Tool handler function: calls Odoo's `action_reopen` on `ppm.milestone` and returns the updated record state.
@mcp.tool() def ppm_milestone_reopen(milestone_id: int) -> dict[str, Any]: """Reopen a milestone back to 'planned'.""" client().call_action("ppm.milestone", "action_reopen", [milestone_id]) return _read_state("ppm.milestone", milestone_id, _MILESTONE_FIELDS) - src/qod_ppm_mcp/server.py:72-73 (registration)The @mcp.tool() decorator registers ppm_milestone_reopen as an MCP tool on the FastMCP server instance.
@mcp.tool() def ppm_milestone_reopen(milestone_id: int) -> dict[str, Any]: - src/qod_ppm_mcp/server.py:30-34 (helper)Helper function _read_state reads the updated record from Odoo after the action is performed.
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] - src/qod_ppm_mcp/server.py:41-41 (helper)Fields list used to read milestone state after the reopen action.
_MILESTONE_FIELDS = ["name", "state", "date_planned", "date_actual", "project_id"] - src/qod_ppm_mcp/client.py:122-124 (helper)OdooClient.call_action dispatches the server action method to the Odoo JSON-RPC API.
def call_action(self, model: str, method: str, ids: list[int]) -> Any: """Invoke an `action_*` button method on the given record ids.""" return self.execute_kw(model, method, [ids])