ppm_risk_reopen
Reopen a closed risk to return it to the 'identified' status for further assessment.
Instructions
Reopen a closed risk back to 'identified'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| risk_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/qod_ppm_mcp/server.py:254-258 (handler)Tool handler that reopens a closed risk by calling the Odoo 'action_reopen' server action on ppm.risk, then reads back the updated state fields.
@mcp.tool() def ppm_risk_reopen(risk_id: int) -> dict[str, Any]: """Reopen a closed risk back to 'identified'.""" client().call_action("ppm.risk", "action_reopen", [risk_id]) return _read_state("ppm.risk", risk_id, _RISK_FIELDS) - src/qod_ppm_mcp/server.py:206-216 (schema)Schema definition of the fields returned by ppm_risk_reopen (and other risk tools).
_RISK_FIELDS = [ "name", "state", "risk_type", "probability", "impact", "risk_score", "risk_level", "project_id", "owner_id", ] - src/qod_ppm_mcp/server.py:253-254 (registration)Registration of ppm_risk_reopen as an MCP tool via the @mcp.tool() decorator on FastMCP instance.
@mcp.tool() - src/qod_ppm_mcp/server.py:23-27 (helper)Helper function providing the OdooClient singleton used by ppm_risk_reopen.
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 function that reads and returns the record state 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]