from odoo import fields, models class FlDocument(models.Model): """ Phase 4 — Full implementation with QWeb report generation. Phase 1: Stub with core fields. """ _name = 'fl.document' _description = 'Case Document' _inherit = ['mail.thread'] _order = 'create_date desc' case_id = fields.Many2one( 'fl.case', required=True, ondelete='cascade', index=True ) name = fields.Char(string='Document Name', required=True) document_type = fields.Selection([ ('financial_affidavit_short', 'Financial Affidavit Short (FL-12.902(b))'), ('financial_affidavit_long', 'Financial Affidavit Long (FL-12.902(c))'), ('support_worksheet', 'Child Support Worksheet (FL-12.902(e))'), ('motion_to_modify', 'Motion to Modify Child Support'), ('notice_deposition', 'Notice of Taking Deposition'), ('motion_to_compel', 'Motion to Compel (FL 1.380)'), ('motion_default', 'Motion for Default (FL 12.922)'), ('income_withholding', 'Income Withholding Order (FL 61.1301)'), ('parenting_plan', 'Parenting Plan (FL-12.995(a))'), ('fee_waiver', 'Application for Civil Indigent Status (FL 57.082)'), ('notice_ssn', 'Notice of SSN (FL-12.930(a))'), ('mandatory_disclosure', 'Certificate of Mandatory Disclosure (FL-12.932)'), ('duces_tecum', 'Subpoena Duces Tecum'), ('other', 'Other Document'), ], string='Document Type') state = fields.Selection([ ('draft', 'Draft'), ('generated', 'Generated'), ('signed', 'Signed'), ('filed', 'Filed with Court'), ], string='Status', default='draft', tracking=True) attachment_ids = fields.Many2many( 'ir.attachment', 'fl_document_attachment_rel', 'document_id', 'attachment_id', string='Files' ) notes = fields.Text(string='Notes') requires_notarization = fields.Boolean( string='Requires Notarization', help='Financial affidavits must be notarized before filing' ) notarized = fields.Boolean(string='Notarized') filed_date = fields.Date(string='Filed with Court Date')