Name:
[ADD] viin_ai_approval(+account,+sale,+ops_brain): P-OPS-2 approval governance + AI advisory on human approvals
State:
Killed
PR State:
merged
PR Author:
David Tran
PR Author Email:
PR:
#47
Committer:
David Tran
Committer Email:
davidtran.hp@gmail.com
Commit:
1dffee8a31c2c5a935ac4873c1c94630f7ac9677
Description:
[ADD] viin_ai_approval,viin_ai_ops_brain: P-OPS-2 approval adapter + Brain evidence
Wire the propose -> DECIDE -> remember steps of the AI operating model (Phase 3.8,
opens gate M3). Two new Community-compatible modules + small reconciles:
* viin_ai_approval (depends viin_ai_ops, viin_approval 0.2.2): maps
viin.ai.action.proposal <-> viin.approval.request. action_route submits a
pending proposal to an approval request; action_validate/refuse/cancel
overrides sync state back to the proposal (+ work item). Sudo/high-risk
proposals are forced through approval (never auto-execute). Community fallback
executes an approved proposal single-step via its mapped ir.actions.server
(state='ai_prompt') under sudo, and only marks 'executed' when a side effect
actually ran - otherwise it stays 'approved' (execution deferred to P-OPS-3 /
the Enterprise viin_workflow_automation when present). Evidence (trace, prompt
snapshot, iteration index) captured on the request.
* viin_ai_ops_brain (depends viin_ai_ops, viin_brain): generates a Brain
"Approval Rationale" evidence page per proposal with mandatory T5 attribution
(is_ai_authored + agent + trace + confidence), untrusted text html-escaped,
linked back to proposal/work item/goal. Idempotent.
* viin_ai_ops: base proposal form now provides one shared oe_button_box (first
child of sheet) so adapter stat buttons hoist to a single control-panel box.
* viin_ai_agent: deprecated stub anchors (viin.ai.schedule,
viin.ai.approval.chain) docstrings point to the shipped viin_ai_approval
adapter; field anchors retained for v17 schema compatibility (removal deferred).
Tests: 54 Odoo-native tests pass (ACL, 2-way sync, sudo/high-risk enforce,
Community fallback honesty + Enterprise-defer, T5 attribution, cross-module
integration). The workflow-dependent fallback tests force _workflow_automation_installed
deterministically (FIRST-compliant) so they pass whether or not the Enterprise
module is installed. Visual UI/UX review PASS (single button box, AA contrast,
theme-faithful, console clean).
Branch:
17.0
Instance ID:
0
Age:
Up-time:
Not finished