Full fl_deadline.py: - Calendar event creation/update on every deadline (all-day events) - _cron_check_default_judgment: FL 12.922 — if respondent misses Day 20 answer deadline, auto-creates Motion for Default deadline (5 days), project task, and urgent chatter alert - _cron_deadline_alerts: 7/3/1-day and overdue chatter alerts - Complete service-anchored deadline set: response (Day 20), financial disclosure + mandatory disclosure cert (Day 45), discovery opens (Day 20), respondent parenting class (Day 60), 120-day service max - context-flag pattern (_no_calendar_sync) to prevent recursive write loops Full fl_hearing.py: - Calendar event sync (show_as=busy, confidential) - Pre-hearing checklist computed fields: parenting class (FL 61.21), discovery cutoff (hearing -30 days), financial disclosure status - Workflow buttons: Mark Completed, Mark Continued, Cancel - _create_hearing_deadline: creates fl.deadline record for each hearing New data/fl_deadline_rules.xml: - ir.cron: Daily Deadline Alerts (fl_deadline._cron_deadline_alerts) - ir.cron: Default Judgment Check (fl_deadline._cron_check_default_judgment) - ir.cron: Emancipation Alerts (fl_child._cron_emancipation_alerts) New data/mail_templates.xml: - Deadline Alert Upcoming (EN) - Deadline Alert OVERDUE (EN) - Portal Welcome (EN + ES bilingual) - Default Judgment Window Alert (EN) Enhanced views: deadline + hearing now have calendar view, search view with filters (overdue, due this week, by type), and group-by options. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
202 lines
12 KiB
XML
202 lines
12 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data>
|
|
|
|
<!-- ══════════════════════════════════════════════════════
|
|
TREE VIEW
|
|
══════════════════════════════════════════════════════ -->
|
|
<record id="view_fl_hearing_tree" model="ir.ui.view">
|
|
<field name="name">fl.hearing.tree</field>
|
|
<field name="model">fl.hearing</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="Hearings"
|
|
decoration-success="state == 'completed'"
|
|
decoration-danger="state == 'cancelled'"
|
|
decoration-warning="state == 'continued'"
|
|
decoration-info="state == 'scheduled'">
|
|
<field name="case_id"/>
|
|
<field name="name"/>
|
|
<field name="hearing_type"/>
|
|
<field name="hearing_date"/>
|
|
<field name="location" optional="show"/>
|
|
<field name="courtroom" optional="show"/>
|
|
<field name="state" widget="badge"
|
|
decoration-success="state == 'completed'"
|
|
decoration-danger="state == 'cancelled'"
|
|
decoration-warning="state == 'continued'"
|
|
decoration-info="state == 'scheduled'"/>
|
|
<field name="order_entered" optional="show"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- ══════════════════════════════════════════════════════
|
|
FORM VIEW
|
|
══════════════════════════════════════════════════════ -->
|
|
<record id="view_fl_hearing_form" model="ir.ui.view">
|
|
<field name="name">fl.hearing.form</field>
|
|
<field name="model">fl.hearing</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Hearing">
|
|
<header>
|
|
<button name="action_mark_completed" string="Mark Completed"
|
|
type="object" class="oe_highlight"
|
|
attrs="{'invisible': [('state', '!=', 'scheduled')]}"/>
|
|
<button name="action_mark_continued" string="Mark Continued"
|
|
type="object"
|
|
attrs="{'invisible': [('state', '!=', 'scheduled')]}"/>
|
|
<button name="action_cancel" string="Cancel Hearing"
|
|
type="object" confirm="Cancel this hearing? This cannot be undone."
|
|
attrs="{'invisible': [('state', 'not in', ['scheduled', 'continued'])]}"/>
|
|
<field name="state" widget="statusbar"
|
|
statusbar_visible="scheduled,completed,cancelled,continued"/>
|
|
</header>
|
|
<sheet>
|
|
<!-- Outcome section — shown after completion -->
|
|
<div class="alert alert-success" role="alert"
|
|
attrs="{'invisible': [('state', '!=', 'completed')]}">
|
|
<strong>✅ Hearing Completed</strong>
|
|
<span attrs="{'invisible': [('outcome', '=', False)]}">
|
|
— <field name="outcome" readonly="1" nolabel="1"/>
|
|
</span>
|
|
<span attrs="{'invisible': [('outcome', '!=', False)]}">
|
|
— Update the Outcome field below with the judge's ruling.
|
|
</span>
|
|
</div>
|
|
<!-- Continued notice -->
|
|
<div class="alert alert-warning" role="alert"
|
|
attrs="{'invisible': [('state', '!=', 'continued')]}">
|
|
<strong>⏸️ Hearing Continued</strong> — Contact the court for
|
|
the rescheduled date and create a new hearing record.
|
|
</div>
|
|
<!-- Cancelled notice -->
|
|
<div class="alert alert-danger" role="alert"
|
|
attrs="{'invisible': [('state', '!=', 'cancelled')]}">
|
|
<strong>❌ Hearing Cancelled</strong>
|
|
</div>
|
|
|
|
<group>
|
|
<group string="Hearing Details">
|
|
<field name="case_id"/>
|
|
<field name="name"/>
|
|
<field name="hearing_type"/>
|
|
<field name="hearing_date"/>
|
|
<field name="duration_hours"/>
|
|
</group>
|
|
<group string="Location">
|
|
<field name="location"/>
|
|
<field name="courtroom"/>
|
|
<field name="judge_id"/>
|
|
<field name="calendar_event_id" readonly="1"
|
|
attrs="{'invisible': [('calendar_event_id', '=', False)]}"/>
|
|
</group>
|
|
</group>
|
|
|
|
<!-- Pre-Hearing Checklist -->
|
|
<group string="Pre-Hearing Checklist (FL Requirements)">
|
|
<div class="o_field_widget">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<strong>Parenting Class (FL 61.21):</strong><br/>
|
|
<field name="parenting_class_warning" readonly="1" nolabel="1"/>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<strong>Discovery Cutoff:</strong><br/>
|
|
<field name="discovery_cutoff_warning" readonly="1" nolabel="1"/>
|
|
</div>
|
|
</div>
|
|
<div class="row mt-2">
|
|
<div class="col-md-6">
|
|
<strong>Financial Disclosure (FL 12.285):</strong><br/>
|
|
<field name="financial_disclosure_warning" readonly="1" nolabel="1"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</group>
|
|
|
|
<!-- Outcome (visible after hearing) -->
|
|
<group string="Outcome"
|
|
attrs="{'invisible': [('state', 'not in', ['completed', 'continued'])]}">
|
|
<field name="order_entered"/>
|
|
<field name="outcome" placeholder="Describe the judge's ruling, any orders entered, next steps..."/>
|
|
</group>
|
|
|
|
<field name="notes"
|
|
placeholder="Pre-hearing preparation notes: exhibits to bring, arguments to make, questions for the judge..."/>
|
|
</sheet>
|
|
<div class="oe_chatter">
|
|
<field name="message_follower_ids"/>
|
|
<field name="message_ids"/>
|
|
</div>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- ══════════════════════════════════════════════════════
|
|
CALENDAR VIEW
|
|
══════════════════════════════════════════════════════ -->
|
|
<record id="view_fl_hearing_calendar" model="ir.ui.view">
|
|
<field name="name">fl.hearing.calendar</field>
|
|
<field name="model">fl.hearing</field>
|
|
<field name="arch" type="xml">
|
|
<calendar string="Hearing Calendar"
|
|
date_start="hearing_date"
|
|
date_stop="hearing_date"
|
|
color="hearing_type"
|
|
mode="month"
|
|
quick_create="False">
|
|
<field name="name"/>
|
|
<field name="case_id"/>
|
|
<field name="hearing_type"/>
|
|
<field name="state"/>
|
|
<field name="location"/>
|
|
</calendar>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- ══════════════════════════════════════════════════════
|
|
SEARCH VIEW
|
|
══════════════════════════════════════════════════════ -->
|
|
<record id="view_fl_hearing_search" model="ir.ui.view">
|
|
<field name="name">fl.hearing.search</field>
|
|
<field name="model">fl.hearing</field>
|
|
<field name="arch" type="xml">
|
|
<search string="Search Hearings">
|
|
<field name="name"/>
|
|
<field name="case_id"/>
|
|
<field name="hearing_type"/>
|
|
<filter string="Scheduled" name="filter_scheduled"
|
|
domain="[('state', '=', 'scheduled')]"/>
|
|
<filter string="Upcoming (30 days)" name="filter_upcoming"
|
|
domain="[('hearing_date', '>=', context_today().strftime('%Y-%m-%d')), ('hearing_date', '<=', (context_today() + relativedelta(days=30)).strftime('%Y-%m-%d')), ('state', '=', 'scheduled')]"/>
|
|
<filter string="Completed" name="filter_completed"
|
|
domain="[('state', '=', 'completed')]"/>
|
|
<filter string="Final Hearings" name="type_final"
|
|
domain="[('hearing_type', '=', 'final')]"/>
|
|
<group string="Group By">
|
|
<filter string="Case" name="group_case"
|
|
context="{'group_by': 'case_id'}"/>
|
|
<filter string="Type" name="group_type"
|
|
context="{'group_by': 'hearing_type'}"/>
|
|
<filter string="Status" name="group_state"
|
|
context="{'group_by': 'state'}"/>
|
|
</group>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- ══════════════════════════════════════════════════════
|
|
ACTIONS
|
|
══════════════════════════════════════════════════════ -->
|
|
<record id="action_fl_hearing_list" model="ir.actions.act_window">
|
|
<field name="name">Hearings</field>
|
|
<field name="res_model">fl.hearing</field>
|
|
<field name="view_mode">tree,calendar,form</field>
|
|
<field name="search_view_id" ref="view_fl_hearing_search"/>
|
|
<field name="domain">[('state', '=', 'scheduled')]</field>
|
|
<field name="context">{'search_default_filter_scheduled': 1}</field>
|
|
</record>
|
|
|
|
</data>
|
|
</odoo>
|