Commit Graph

7 Commits

Author SHA1 Message Date
c1b5947b7c Make module installable on stock Odoo 18 (verified via test DB install)
Caught and fixed by running an actual install on a throwaway DB:

- Strip 29 # comment lines from ir.model.access.csv (Odoo CSV loader treats
  them as malformed rows → IndexError); 79 data rows preserved
- Remove obsolete ir.cron.numbercall field (removed in Odoo 17+) from 4 cron
  records in fl_deadline_rules.xml
- Rename <tree>→<list> across 26 sites; inside x2many inline views Odoo 18 no
  longer recognizes <tree>, which made it fall back to the outer model and
  reject inner fields ("Field 'partner_id' does not exist in model 'fl.case'")
- Add store=True to non-stored computed fields referenced by search filters,
  which Odoo 18 now rejects as unsearchable:
  - fl.case: overdue_deadline_count, next_deadline_label
  - fl.deposition: notice_valid

Module loads cleanly: 31 fl.* models registered, no errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 03:28:55 +00:00
6f6129550e Add FL e-Filing Portal integration (assisted submission, Phase 1)
- fl.efiling.submission: generates the 11th Circuit court filename
  ({LastName}_{CaseNumber}_{DocumentType}_{YYYYMMDD}.pdf), validates PDF/A via
  pikepdf (XMP pdfaid + OutputIntents, graceful if pikepdf missing), and tracks
  status (draft → validated → pending_manual → submitted → accepted/rejected/failed)
- Assisted flow: "Open e-Filing Portal" deep-links to eportal.flcourts.org
  (?caseNumber=… when available; base overridable via ir.config_parameter
  fl_efiling.portal_url); confirmation # capture; accepted/rejected mark the
  linked fl.document filed and log to chatter
- Phase 2 API stub (action_submit_api) reads creds/endpoint from ir.config_parameter
  and refuses to call an unconfirmed endpoint — no guessed URLs, no silent failure
- fl.efiling.wizard: pick document/attachment/filing_type, preview the filename,
  create + auto-validate the submission
- Wiring: model + wizard registered, ACL (admin/paralegal), e-filing views, Cases
  menu item, fl.case.efiling_submission_ids + Filings tab + Prepare e-Filing button

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 00:42:28 +00:00
70c951a7ef Add timesheet / AI-audit time tracking (wraps account.analytic.line)
- fl.timesheet via delegation inheritance on account.analytic.line so billable
  hours flow through standard Odoo Accounting; duration_hours maps to unit_amount
- Fields: case_id, employee_id, is_billable, ai_agent, duration_hours, computed
  hourly_rate/billable_amount (rate from hr.employee.fl_hourly_rate, else firm
  default ir.config_parameter fl_timesheet.default_hourly_rate)
- _resolve_analytic_account: prefers the case project's analytic account
  (version-agnostic field lookup), falls back to a cached firm account under any
  available analytic plan — handles the required account_id on the wrapped line
- Add 'analytic' to manifest depends; ACL for fl.timesheet and account.analytic.line
  (admin + paralegal) so non-admins can post entries
- fl.case: timesheet_ids + total_billable_hours/amount + total_ai_audit_hours +
  currency_id; new Time & Billing tab; Timesheets menu + standalone views
- Both AI agents now log non-billable audit entries via sudo() (paralegal +
  attorney, ai_agent set); logging stays a guarded no-op if creation fails

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 00:26:00 +00:00
7bc0cc8554 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>
2026-05-28 18:19:32 +00:00
b8ab8494c7 Migrate AI engine to Claude API; convert stage field to Many2one Kanban model
- Replace fl.case.stage Selection field with Many2one → fl.case.stage model,
  enabling Kanban grouping and dynamic stage management
- Add FlCaseStage model (sequence, fold, description) and fl_stage_data.xml
  with all 11 procedural stages seeded with noupdate=1
- Migrate fl_ai_engine.py from Ollama/llama3.1 to Claude API
  (claude-sonnet-4-20250514); key from ir.config_parameter fl_ai.claude_api_key
- Fix stale field references in _rule_based_tagging and _build_case_context:
  employment/income now read from party_ids, timesharing fields corrected
- Add _fallback_complexity() for graceful degradation when API unavailable
- Add Kanban view to fl_case_views.xml; update action view_mode to kanban,tree,form
- Add fl.case.stage ACL entries to ir.model.access.csv

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 17:45:26 +00:00
Carlos Garcia
928568374e Add complexity-driven discovery suggestion wizard
fl_discovery_suggest_wizard.py:
  - fl.discovery.suggest.wizard: reads case complexity (AI analysis or
    rule-based fallback), case type, issue_tag_ids, and flags
    (domestic_violence_flag, respondent_has_counsel, income_imputation_concern)
    to build a pre-checked list of relevant discovery items
  - fl.discovery.suggest.line: one row per suggested item with type,
    directed_to, description, rationale, trigger badge, and min complexity
  - 50+ templates across 10 trigger categories: base, modification,
    dissolution, paternity, alimony, custody, imputation (Barner v. Barner),
    self_employment, domestic_violence, respondent_counsel, complex_only
  - action_create_selected: creates fl.discovery records (draft) and posts
    a chatter summary with all created items; bound to fl.case form

fl_case.py:
  - Add issue_tag_ids Many2many(fl.issue.tag) — field referenced by AI
    engine rule-tagging but not previously declared on the model

fl_discovery_suggest_views.xml:
  - Wizard form: complexity badge, alert box explaining level, editable
    suggestion list with trigger/type/description/rationale columns
  - Action bound to fl.case form via binding_model_id
  - Inherits fl.case form to add issue_tag_ids widget to AI tab

ir.model.access.csv: access rows for both new wizard models

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 00:50:07 -05:00
Carlos Garcia
1d52d85a78 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>
2026-05-04 18:52:04 -04:00