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

@@ -18,6 +18,9 @@
<button name="action_open_support_calculator" string="Open Calculator"
type="object"
attrs="{'invisible': [('case_type', 'not in', ['modification','dissolution_children','paternity','custody_modification'])]}"/>
<button name="action_run_conflict_check" string="Run Conflict Check"
type="object"
groups="activeblue_familylaw.group_admin,activeblue_familylaw.group_paralegal"/>
</header>
<!-- Attorney Referral Banner -->
@@ -29,6 +32,18 @@
<br/>Legal Services of Greater Miami: (305) 576-0080
</div>
<!-- Conflict of Interest Banner -->
<div class="alert alert-danger" role="alert"
attrs="{'invisible': ['|', ('conflict_check_passed', '=', True), ('conflict_check_id', '=', False)]}">
<strong>🚩 CONFLICT OF INTEREST — UNRESOLVED</strong>
— A conflict check has flagged matching parties on other open cases.
This case cannot advance past Intake until the conflict is overridden by an administrator.
Open the
<button name="action_run_conflict_check" type="object"
class="btn btn-link p-0 align-baseline" string="conflict check"/>
for details.
</div>
<!-- DV Safety Note -->
<field name="dv_safety_note" widget="html"
attrs="{'invisible': [('domestic_violence_flag', '=', False)]}"/>
@@ -97,10 +112,16 @@
<field name="respondent_answered"/>
</group>
</group>
<group string="Safety Flags">
<field name="domestic_violence_flag"/>
<field name="dv_injunction_active"
attrs="{'invisible': [('domestic_violence_flag', '=', False)]}"/>
<group>
<group string="Safety Flags">
<field name="domestic_violence_flag"/>
<field name="dv_injunction_active"
attrs="{'invisible': [('domestic_violence_flag', '=', False)]}"/>
</group>
<group string="Conflict of Interest">
<field name="conflict_check_passed" readonly="1"/>
<field name="conflict_check_id" readonly="1"/>
</group>
</group>
<separator string="Party Details (Income, Employment, Service)"/>
<field name="party_ids">
@@ -375,6 +396,8 @@
<field name="attorney_referral_flag"/>
<field name="domestic_violence_flag"/>
<field name="overdue_deadline_count"/>
<field name="conflict_check_passed"/>
<field name="conflict_check_id"/>
<field name="petitioner_id"/>
<templates>
<t t-name="kanban-card">
@@ -404,6 +427,9 @@
<t t-esc="record.overdue_deadline_count.raw_value"/> Overdue
</span>
</t>
<t t-if="record.conflict_check_id.raw_value &amp;&amp; !record.conflict_check_passed.raw_value">
<span class="badge rounded-pill text-bg-danger ms-1">Conflict</span>
</t>
</div>
<div class="o_kanban_record_bottom" t-if="record.next_deadline.raw_value">
<div class="oe_kanban_bottom_left text-muted small">