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:
3
activeblue_familylaw/wizard/__init__.py
Normal file
3
activeblue_familylaw/wizard/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from . import fl_intake_wizard
|
||||
from . import fl_analysis_wizard
|
||||
from . import fl_generate_packet_wizard
|
||||
30
activeblue_familylaw/wizard/fl_analysis_wizard.py
Normal file
30
activeblue_familylaw/wizard/fl_analysis_wizard.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class FlAnalysisWizard(models.TransientModel):
|
||||
"""
|
||||
Trigger AI analysis on a case.
|
||||
Phase 7 — full implementation.
|
||||
Phase 1: Stub.
|
||||
"""
|
||||
_name = 'fl.analysis.wizard'
|
||||
_description = 'Trigger AI Analysis Wizard'
|
||||
|
||||
case_id = fields.Many2one(
|
||||
'fl.case', string='Case', required=True
|
||||
)
|
||||
force_reanalysis = fields.Boolean(
|
||||
string='Force Re-analysis',
|
||||
help='Run a new analysis even if a recent one exists'
|
||||
)
|
||||
|
||||
def action_run_analysis(self):
|
||||
self.env['fl.ai.engine'].analyze_case(self.case_id.id)
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': 'Case',
|
||||
'res_model': 'fl.case',
|
||||
'res_id': self.case_id.id,
|
||||
'view_mode': 'form',
|
||||
'target': 'current',
|
||||
}
|
||||
56
activeblue_familylaw/wizard/fl_generate_packet_wizard.py
Normal file
56
activeblue_familylaw/wizard/fl_generate_packet_wizard.py
Normal file
@@ -0,0 +1,56 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class FlGeneratePacketWizard(models.TransientModel):
|
||||
"""
|
||||
Generate full filing packet for a case.
|
||||
Phase 7 — full implementation with batch PDF generation.
|
||||
Phase 1: Stub.
|
||||
"""
|
||||
_name = 'fl.generate.packet.wizard'
|
||||
_description = 'Generate Filing Packet Wizard'
|
||||
|
||||
case_id = fields.Many2one(
|
||||
'fl.case', string='Case', required=True
|
||||
)
|
||||
include_financial_affidavit = fields.Boolean(
|
||||
string='Financial Affidavit', default=True
|
||||
)
|
||||
include_support_worksheet = fields.Boolean(
|
||||
string='Child Support Worksheet (FL-12.902(e))', default=True
|
||||
)
|
||||
include_motion_to_modify = fields.Boolean(
|
||||
string='Motion to Modify Child Support', default=True
|
||||
)
|
||||
include_notice_ssn = fields.Boolean(
|
||||
string='Notice of Social Security Number (FL-12.930(a))', default=True
|
||||
)
|
||||
include_mandatory_disclosure = fields.Boolean(
|
||||
string='Certificate of Mandatory Disclosure (FL-12.932)', default=True
|
||||
)
|
||||
include_fee_waiver = fields.Boolean(
|
||||
string='Fee Waiver Application (if eligible)', default=False
|
||||
)
|
||||
language = fields.Selection([
|
||||
('en', 'English'),
|
||||
('es', 'Spanish / Español'),
|
||||
('both', 'Bilingual'),
|
||||
], string='Document Language', default='en')
|
||||
|
||||
def action_generate(self):
|
||||
"""
|
||||
Phase 7 — generate all selected documents as PDFs.
|
||||
Phase 1: Stub — posts a note and returns to case.
|
||||
"""
|
||||
self.case_id.message_post(
|
||||
body='📄 Filing packet generation will be available in Phase 4 (Document Templates).',
|
||||
subtype_xmlid='mail.mt_note',
|
||||
)
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': 'Case',
|
||||
'res_model': 'fl.case',
|
||||
'res_id': self.case_id.id,
|
||||
'view_mode': 'form',
|
||||
'target': 'current',
|
||||
}
|
||||
56
activeblue_familylaw/wizard/fl_intake_wizard.py
Normal file
56
activeblue_familylaw/wizard/fl_intake_wizard.py
Normal file
@@ -0,0 +1,56 @@
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class FlIntakeWizard(models.TransientModel):
|
||||
"""
|
||||
Guided case creation wizard.
|
||||
Phase 7 — full multi-step intake form.
|
||||
Phase 1: Stub with basic fields.
|
||||
"""
|
||||
_name = 'fl.intake.wizard'
|
||||
_description = 'Family Law Case Intake Wizard'
|
||||
|
||||
case_type = fields.Selection([
|
||||
('modification', 'Child Support Modification'),
|
||||
('dissolution_children', 'Dissolution of Marriage — With Children'),
|
||||
('dissolution_no_children', 'Dissolution of Marriage — No Children'),
|
||||
('paternity', 'Paternity'),
|
||||
('alimony_modification', 'Alimony Modification'),
|
||||
('custody_modification', 'Timesharing / Custody Modification'),
|
||||
], string='Case Type', required=True)
|
||||
|
||||
petitioner_id = fields.Many2one(
|
||||
'res.partner', string='Petitioner', required=True
|
||||
)
|
||||
respondent_id = fields.Many2one(
|
||||
'res.partner', string='Respondent'
|
||||
)
|
||||
domestic_violence_flag = fields.Boolean(
|
||||
string='Is there a history of domestic violence?',
|
||||
help='Your answer affects mediation and safety procedures'
|
||||
)
|
||||
has_minor_children = fields.Boolean(
|
||||
string='Are there minor children involved?'
|
||||
)
|
||||
petitioner_fl_resident_since = fields.Date(
|
||||
string='When did the petitioner become a FL resident?',
|
||||
help='FL 61.021: Must be 6 months before filing'
|
||||
)
|
||||
|
||||
def action_create_case(self):
|
||||
"""Create the fl.case record from intake data."""
|
||||
case = self.env['fl.case'].create({
|
||||
'case_type': self.case_type,
|
||||
'petitioner_id': self.petitioner_id.id,
|
||||
'respondent_id': self.respondent_id.id if self.respondent_id else False,
|
||||
'domestic_violence_flag': self.domestic_violence_flag,
|
||||
'petitioner_fl_resident_since': self.petitioner_fl_resident_since,
|
||||
})
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': 'New Case',
|
||||
'res_model': 'fl.case',
|
||||
'res_id': case.id,
|
||||
'view_mode': 'form',
|
||||
'target': 'current',
|
||||
}
|
||||
Reference in New Issue
Block a user