Phase 1: core models, security, seed data, and backend views
Implements full Phase 1 of the activeblue_familylaw Odoo 18 module: - 17 Python models (fl.case, fl.party, fl.child, fl.support.calculation, fl.fee.waiver, fl.income.withholding, fl.deadline, fl.hearing, fl.deposition, fl.discovery, fl.document, fl.caselaw, fl.analysis, fl.ai.engine, fl.argument, fl.statute, fl.issue.tag) + hr.expense extension - 3 wizard stubs (intake, analysis, generate-packet) - Security: 4 groups (admin/paralegal/portal-petitioner/portal-respondent) + record rules scoping portal users to their own cases - Seed data: issue tags, FL statutes, FL DCF support schedule, ir.sequence - 13 backend view XML files with FL 61.30 worksheet, fee waiver eligibility banner, DV safety resources, emancipation alerts - Static CSS/JS stubs for Phase 6 portal Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
79
activeblue_familylaw/models/fl_analysis.py
Normal file
79
activeblue_familylaw/models/fl_analysis.py
Normal file
@@ -0,0 +1,79 @@
|
||||
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.
|
||||
"""
|
||||
_name = 'fl.analysis'
|
||||
_description = 'AI Case Analysis Result'
|
||||
_order = 'create_date desc'
|
||||
|
||||
case_id = fields.Many2one(
|
||||
'fl.case', ondelete='cascade', index=True
|
||||
)
|
||||
analysis_date = fields.Datetime(
|
||||
string='Analysis Date',
|
||||
default=fields.Datetime.now
|
||||
)
|
||||
model_used = fields.Char(
|
||||
string='AI Model',
|
||||
default='llama3.1'
|
||||
)
|
||||
|
||||
# ── Results (referenced by fl_case related fields) ─────────────────────
|
||||
attorney_referral_flag = fields.Boolean(
|
||||
string='Attorney Referral Recommended',
|
||||
default=False
|
||||
)
|
||||
attorney_referral_reason = fields.Text(
|
||||
string='Attorney Referral Reason'
|
||||
)
|
||||
plain_english_summary = fields.Text(
|
||||
string='Plain English Summary (EN)',
|
||||
help='3-5 sentence summary of case analysis — no legal jargon'
|
||||
)
|
||||
plain_english_summary_es = fields.Text(
|
||||
string='Plain English Summary (ES)',
|
||||
help='Resumen en español — sin jerga legal'
|
||||
)
|
||||
|
||||
# ── Analysis Detail (Phase 5) ──────────────────────────────────────────
|
||||
petitioner_arguments = fields.Text(
|
||||
string='Petitioner Arguments (JSON)'
|
||||
)
|
||||
respondent_counterarguments = fields.Text(
|
||||
string='Respondent Counter-Arguments (JSON)'
|
||||
)
|
||||
procedural_risks = fields.Text(
|
||||
string='Procedural Risks (JSON)'
|
||||
)
|
||||
matched_caselaw_ids = fields.Many2many(
|
||||
'fl.caselaw',
|
||||
'fl_analysis_caselaw_rel',
|
||||
'analysis_id', 'caselaw_id',
|
||||
string='Matched Case Law'
|
||||
)
|
||||
confidence_level = fields.Selection([
|
||||
('high', 'High'),
|
||||
('medium', 'Medium'),
|
||||
('low', 'Low'),
|
||||
], string='Confidence Level')
|
||||
case_complexity = fields.Selection([
|
||||
('simple', 'Simple'),
|
||||
('moderate', 'Moderate'),
|
||||
('complex', 'Complex'),
|
||||
], string='Case Complexity')
|
||||
raw_response = fields.Text(
|
||||
string='Raw AI Response',
|
||||
help='Full JSON response from Ollama — for debugging'
|
||||
)
|
||||
error_message = fields.Text(
|
||||
string='Error (if analysis failed)'
|
||||
)
|
||||
state = fields.Selection([
|
||||
('pending', 'Pending'),
|
||||
('complete', 'Complete'),
|
||||
('failed', 'Failed'),
|
||||
], string='Status', default='pending')
|
||||
Reference in New Issue
Block a user