ppm_change_request_reset_draft
Reset a submitted or rejected change request to draft by providing its ID.
Instructions
Return a submitted or rejected Change Request to draft.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cr_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/qod_ppm_mcp/server.py:195-199 (handler)The tool handler for ppm_change_request_reset_draft. Calls Odoo's action_reset_draft on ppm.change.request to return a submitted or rejected Change Request back to draft state, then reads and returns the current state fields.
@mcp.tool() def ppm_change_request_reset_draft(cr_id: int) -> dict[str, Any]: """Return a submitted or rejected Change Request to draft.""" client().call_action("ppm.change.request", "action_reset_draft", [cr_id]) return _read_state("ppm.change.request", cr_id, _CR_FIELDS) - src/qod_ppm_mcp/server.py:195-199 (registration)The tool is registered as an MCP tool via the @mcp.tool() decorator on the ppm_change_request_reset_draft function, using FastMCP's automatic tool registration.
@mcp.tool() def ppm_change_request_reset_draft(cr_id: int) -> dict[str, Any]: """Return a submitted or rejected Change Request to draft.""" client().call_action("ppm.change.request", "action_reset_draft", [cr_id]) return _read_state("ppm.change.request", cr_id, _CR_FIELDS) - src/qod_ppm_mcp/server.py:159-159 (schema)The _CR_FIELDS list defines the schema of fields returned by the tool (name, state, project_id, change_type, priority, initiator_id).
_CR_FIELDS = ["name", "state", "project_id", "change_type", "priority", "initiator_id"] - src/qod_ppm_mcp/client.py:122-125 (helper)The call_action helper method on OdooClient that invokes the Odoo server-side action method via JSON-RPC execute_kw.
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])