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:
@@ -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 && !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">
|
||||
|
||||
119
activeblue_familylaw/views/fl_conflict_check_views.xml
Normal file
119
activeblue_familylaw/views/fl_conflict_check_views.xml
Normal file
@@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<!-- ══════════════════════════════════════════════════════
|
||||
FORM VIEW
|
||||
══════════════════════════════════════════════════════ -->
|
||||
<record id="view_fl_conflict_check_form" model="ir.ui.view">
|
||||
<field name="name">fl.conflict.check.form</field>
|
||||
<field name="model">fl.conflict.check</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Conflict of Interest Check">
|
||||
<header>
|
||||
<button name="action_override" string="Override Conflict"
|
||||
type="object" class="oe_highlight"
|
||||
confirm="Override this conflict of interest? This allows the case to advance past Intake. A justification is required."
|
||||
attrs="{'invisible': [('status', '!=', 'conflict')]}"
|
||||
groups="activeblue_familylaw.group_admin"/>
|
||||
<field name="status" widget="statusbar"
|
||||
statusbar_visible="clear,conflict,override"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="alert alert-success" role="alert"
|
||||
attrs="{'invisible': [('status', '!=', 'clear')]}">
|
||||
<strong>✅ CLEAR</strong> — No conflicting parties found on other open cases.
|
||||
</div>
|
||||
<div class="alert alert-danger" role="alert"
|
||||
attrs="{'invisible': [('status', '!=', 'conflict')]}">
|
||||
<strong>🚩 CONFLICT DETECTED</strong> — One or more parties match
|
||||
parties on other open cases. The case cannot advance past Intake
|
||||
until this is overridden by an administrator.
|
||||
</div>
|
||||
<div class="alert alert-warning" role="alert"
|
||||
attrs="{'invisible': [('status', '!=', 'override')]}">
|
||||
<strong>⚠ OVERRIDDEN</strong> — This conflict was overridden by
|
||||
<field name="override_user_id" readonly="1" nolabel="1" class="oe_inline"/>
|
||||
on <field name="override_date" readonly="1" nolabel="1" class="oe_inline"/>.
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="case_id"/>
|
||||
<field name="check_date"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="matched_case_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('matched_case_ids', '=', [])]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<separator string="Match Detail"/>
|
||||
<field name="match_detail" nolabel="1" readonly="1"/>
|
||||
<separator string="Override Justification"
|
||||
attrs="{'invisible': [('status', '=', 'clear')]}"/>
|
||||
<field name="override_justification" nolabel="1"
|
||||
placeholder="Required to override a conflict — explain why the firm may proceed despite the match."
|
||||
attrs="{'invisible': [('status', '=', 'clear')], 'readonly': [('status', '=', 'override')]}"/>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids"/>
|
||||
<field name="message_ids"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ══════════════════════════════════════════════════════
|
||||
TREE VIEW
|
||||
══════════════════════════════════════════════════════ -->
|
||||
<record id="view_fl_conflict_check_tree" model="ir.ui.view">
|
||||
<field name="name">fl.conflict.check.tree</field>
|
||||
<field name="model">fl.conflict.check</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Conflict Checks"
|
||||
decoration-danger="status == 'conflict'"
|
||||
decoration-warning="status == 'override'"
|
||||
decoration-success="status == 'clear'">
|
||||
<field name="case_id"/>
|
||||
<field name="check_date"/>
|
||||
<field name="status"/>
|
||||
<field name="matched_case_ids" widget="many2many_tags"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ══════════════════════════════════════════════════════
|
||||
SEARCH VIEW
|
||||
══════════════════════════════════════════════════════ -->
|
||||
<record id="view_fl_conflict_check_search" model="ir.ui.view">
|
||||
<field name="name">fl.conflict.check.search</field>
|
||||
<field name="model">fl.conflict.check</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Conflict Checks">
|
||||
<field name="case_id"/>
|
||||
<filter string="Conflicts" name="conflicts"
|
||||
domain="[('status', '=', 'conflict')]"/>
|
||||
<filter string="Overridden" name="overridden"
|
||||
domain="[('status', '=', 'override')]"/>
|
||||
<filter string="Clear" name="clear"
|
||||
domain="[('status', '=', 'clear')]"/>
|
||||
<group expand="0" string="Group By">
|
||||
<filter string="Status" name="group_status"
|
||||
context="{'group_by': 'status'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ══════════════════════════════════════════════════════
|
||||
ACTION
|
||||
══════════════════════════════════════════════════════ -->
|
||||
<record id="action_fl_conflict_check_list" model="ir.actions.act_window">
|
||||
<field name="name">Conflict Checks</field>
|
||||
<field name="res_model">fl.conflict.check</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_fl_conflict_check_search"/>
|
||||
<field name="context">{'search_default_conflicts': 1}</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -87,6 +87,13 @@
|
||||
action="action_fl_discovery_list"
|
||||
sequence="60"/>
|
||||
|
||||
<menuitem
|
||||
id="menu_fl_conflict_checks"
|
||||
name="Conflict Checks"
|
||||
parent="menu_fl_cases"
|
||||
action="action_fl_conflict_check_list"
|
||||
sequence="70"/>
|
||||
|
||||
<!-- ══════════════════════════════════════════════════════
|
||||
SUPPORT CALCULATOR SUB-MENU
|
||||
══════════════════════════════════════════════════════ -->
|
||||
|
||||
Reference in New Issue
Block a user