ppm_change_request_approve
Approve a change request under review and automatically create a baseline snapshot.
Instructions
Approve a Change Request under review; creates a baseline snapshot.
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:176-180 (handler)The MCP tool handler for 'ppm_change_request_approve'. Calls Odoo's 'action_approve' on the 'ppm.change.request' model and returns the updated record state.
@mcp.tool() def ppm_change_request_approve(cr_id: int) -> dict[str, Any]: """Approve a Change Request under review; creates a baseline snapshot.""" client().call_action("ppm.change.request", "action_approve", [cr_id]) return _read_state("ppm.change.request", cr_id, _CR_FIELDS) - src/qod_ppm_mcp/server.py:176-176 (registration)The tool is registered with the MCP server via the @mcp.tool() decorator on line 176.
@mcp.tool() - src/qod_ppm_mcp/server.py:159-159 (schema)The schema defines _CR_FIELDS which are the fields returned by the handler after approval.
_CR_FIELDS = ["name", "state", "project_id", "change_type", "priority", "initiator_id"] - src/qod_ppm_mcp/client.py:122-124 (helper)The 'call_action' helper on OdooClient that invokes the button method on the Odoo model.
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]) - src/qod_ppm_mcp/server.py:30-34 (helper)The '_read_state' helper reads the updated 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]