# -*- coding: utf-8 -*- # Copyright 2024-2025 Nexa Systems Inc. # License OPL-1 (Odoo Proprietary License v1.0) # Part of the Fusion Claim Assistant product family. from odoo import models, fields class ResCompany(models.Model): _inherit = 'res.company' # Store/Location Information x_fc_store_address_1 = fields.Char( string='Store Address Line 1', help='First store/location address for reports (e.g., "Main Store - 123 Street, City, Province, Postal")', ) x_fc_store_address_2 = fields.Char( string='Store Address Line 2', help='Second store/location address for reports (optional)', ) x_fc_company_tagline = fields.Char( string='Company Tagline', help='Company tagline/slogan for reports (e.g., "Enhancing Accessibility, Improving Lives.")', ) # Payment Information x_fc_etransfer_email = fields.Char( string='E-Transfer Email', help='Email address for Interac e-Transfers', ) x_fc_cheque_payable_to = fields.Char( string='Cheque Payable To', help='Name for cheque payments (defaults to company name if empty)', ) x_fc_payment_terms_html = fields.Html( string='Payment Terms', help='Payment terms and conditions displayed on reports (supports HTML formatting)', sanitize=True, sanitize_overridable=True, ) # Refund Policy x_fc_include_refund_page = fields.Boolean( string='Include Refund Policy Page', default=True, help='Include a separate refund policy page at the end of reports', ) x_fc_refund_policy_html = fields.Html( string='Refund Policy', help='Full refund policy displayed on a separate page (supports HTML formatting)', sanitize=True, sanitize_overridable=True, ) # Office Notification Recipients x_fc_office_notification_ids = fields.Many2many( 'res.partner', 'fc_company_office_notification_partners_rel', 'company_id', 'partner_id', string='Office Notification Recipients', help='Contacts who will receive a copy (CC) of all automated ADP notifications', ) # ========================================================================== # MARCH OF DIMES SETTINGS (shared blank forms + follow-up assignment) # Added 2026-04 MOD update. Latest revision of the MOD-issued blank forms # lives here so every case can auto-attach them to outgoing emails. # ========================================================================== x_fc_mod_application_form = fields.Binary( string='MOD Application Form (blank)', attachment=True, help='Blank March of Dimes Application Form (latest MOD revision). ' 'Auto-attached to the handoff email sent to the client or authorizer ' 'when they will be submitting the application themselves.', ) x_fc_mod_application_form_filename = fields.Char( string='MOD Application Form Filename', ) x_fc_mod_vod_form = fields.Binary( string='Verification of Disability Form (blank)', attachment=True, help='Blank March of Dimes Verification of Disability form. ' 'Auto-attached to the VOD request email sent to the authorizer when ' 'our office is handling the MOD submission internally.', ) x_fc_mod_vod_form_filename = fields.Char( string='VOD Form Filename', ) x_fc_mod_followup_assignee_mode = fields.Selection( selection=[ ('office_contact', 'Designated Office Contact'), ('sales_rep', 'Order Sales Rep'), ], string='MOD Follow-up Assignee', default='office_contact', help='Who gets the follow-up activity when a client or authorizer is ' 'handling the MOD submission themselves. Office contact = one ' 'designated person handles all follow-ups. Sales rep = the rep ' 'on each order is responsible for their own follow-ups.', ) x_fc_mod_followup_office_contact_id = fields.Many2one( 'res.users', string='MOD Follow-up Office Contact', help='The office user who receives MOD handoff follow-up activities ' 'when assignee mode is set to Office Contact. Only used when ' 'x_fc_mod_followup_assignee_mode == office_contact.', ) def _get_cheque_payable_name(self): """Get the name for cheque payments, defaulting to company name.""" self.ensure_one() return self.x_fc_cheque_payable_to or self.name def _get_mod_followup_assignee(self, sale_order): """Return the res.users who should receive the MOD handoff follow-up activity for the given order, based on this company's configuration. Falls back to the order's sales rep when the office contact is missing. """ self.ensure_one() if self.x_fc_mod_followup_assignee_mode == 'office_contact' and self.x_fc_mod_followup_office_contact_id: return self.x_fc_mod_followup_office_contact_id return sale_order.user_id or self.env.user