Add conflict-of-interest check engine; gate stage advancement at Intake

- New fl.conflict.check model: screens petitioner/respondent/party_ids names
  against parties on other open cases (exact partner match + difflib fuzzy
  match at 0.85 threshold); skips folded/closed stages
- Runs automatically as the first action in fl.case.create; logs conflicts to
  chatter with matched-case detail and never silently passes
- fl.case gains conflict_check_passed/conflict_check_id/conflict_check_ids;
  write() blocks advancing stage_id past Intake until the check passes
- Admin-only action_override requires a written justification, stamps user/date,
  and flips conflict_check_passed True with a chatter audit entry
- Add conflict check form/tree/search views, action, Cases sub-menu item,
  case form banner + Run Conflict Check button, and Kanban conflict badge
- ACL entries for fl.conflict.check (admin full, paralegal no-delete)
- Finish Claude migration cleanup in fl_analysis.py (model_used default,
  docstring/help text)
- Add .gitignore for Python artifacts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-28 18:19:32 +00:00
parent b8ab8494c7
commit 7bc0cc8554
10 changed files with 431 additions and 10 deletions

View File

@@ -2,10 +2,7 @@ from odoo import fields, models
class FlAnalysis(models.Model):
"""
Phase 5 — Full Ollama AI analysis implementation.
Phase 1: Stub with fields required by fl_case computed fields.
"""
"""AI case analysis record. Written by the Claude API engine (fl.ai.engine)."""
_name = 'fl.analysis'
_description = 'AI Case Analysis Result'
_order = 'create_date desc'
@@ -19,7 +16,7 @@ class FlAnalysis(models.Model):
)
model_used = fields.Char(
string='AI Model',
default='llama3.1'
default='claude-sonnet-4-20250514'
)
# ── Results (referenced by fl_case related fields) ─────────────────────
@@ -67,7 +64,7 @@ class FlAnalysis(models.Model):
], string='Case Complexity')
raw_response = fields.Text(
string='Raw AI Response',
help='Full JSON response from Ollama — for debugging'
help='Full JSON response from the Claude API — for debugging'
)
error_message = fields.Text(
string='Error (if analysis failed)'