# -*- coding: utf-8 -*- # Copyright 2024-2026 Nexa Systems Inc. # License OPL-1 (Odoo Proprietary License v1.0) from odoo import models, fields, api class ResPartner(models.Model): _inherit = 'res.partner' # ========================================================================== # CONTACT TYPE # ========================================================================== x_fc_contact_type = fields.Selection( selection=[ ('adp_customer', 'ADP Customer'), ('adp_odsp_customer', 'ADP-ODSP Customer'), ('odsp_customer', 'ODSP Customer'), ('mod_customer', 'MOD Customer'), ('private_customer', 'Private Customer'), ('wsib_customer', 'WSIB Customer'), ('acsd_customer', 'ACSD Customer'), ('private_insurance', 'Private Insurance'), ('adp_agent', 'ADP Agent'), ('odsp_agent', 'ODSP Agent'), ('muscular_dystrophy', 'Muscular Dystrophy'), ('occupational_therapist', 'Occupational Therapist'), ('physiotherapist', 'Physiotherapist'), ('vendor', 'Vendor'), ('funding_agency', 'Funding Agency'), ('government_agency', 'Government Agency'), ('company_contact', 'Company Contact'), ('long_term_care_home', 'Long Term Care Home'), ('retirement_home', 'Retirement Home'), ('odsp_office', 'ODSP Office'), ('other', 'Other'), ], string='Contact Type', tracking=True, index=True, ) # ========================================================================== # ODSP FIELDS # ========================================================================== x_fc_odsp_member_id = fields.Char( string='ODSP Member ID', size=9, tracking=True, help='9-digit Ontario Disability Support Program Member ID', ) x_fc_case_worker_id = fields.Many2one( 'res.partner', string='ODSP Case Worker', tracking=True, help='ODSP Case Worker assigned to this client', ) x_fc_date_of_birth = fields.Date( string='Date of Birth', tracking=True, ) x_fc_healthcard_number = fields.Char( string='Healthcard Number', tracking=True, ) x_fc_is_odsp_office = fields.Boolean( compute='_compute_is_odsp_office', string='Is ODSP Office', store=True, ) @api.depends('x_fc_contact_type') def _compute_is_odsp_office(self): for partner in self: partner.x_fc_is_odsp_office = partner.x_fc_contact_type == 'odsp_office'