ppm_status_report_reset_draft
Revert a published status report to draft state. Undo a publish action to allow editing or corrections.
Instructions
Revert a published status report back to draft.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| report_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/qod_ppm_mcp/server.py:137-141 (handler)The main handler function for the ppm_status_report_reset_draft tool. It calls Odoo's 'action_reset_draft' on the 'ppm.status.report' model and returns the updated state.
@mcp.tool() def ppm_status_report_reset_draft(report_id: int) -> dict[str, Any]: """Revert a published status report back to draft.""" client().call_action("ppm.status.report", "action_reset_draft", [report_id]) return _read_state("ppm.status.report", report_id, ["name", "state", "project_id"]) - src/qod_ppm_mcp/server.py:137-138 (registration)The tool is registered via the @mcp.tool() decorator on line 130 (the decorator applies to the function defined on line 138). This registers it as an MCP tool named 'ppm_status_report_reset_draft'.
@mcp.tool() def ppm_status_report_reset_draft(report_id: int) -> dict[str, Any]: - src/qod_ppm_mcp/server.py:30-34 (helper)The _read_state helper function used by the handler to read and return the status report's state after resetting to draft.
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/client.py:122-124 (helper)The call_action method on OdooClient that actually invokes the Odoo server-side method (action_reset_draft) via JSON-RPC.
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])