Files
Odoo-Modules/fusion_claims/models/res_partner.py
Nexa Admin f3766c2898 feat: add x_fc_authorizer_number, x_fc_account_number, x_marked_for fields; auto-link authorizer from XML
- fusion_claims: added x_fc_authorizer_number to res.partner for ADP authorizer registration numbers
- fusion_claims: XML parser auto-links authorizer contact to sale order by ADP number
- fusion_claims: removed size=9 constraint from x_fc_odsp_member_id
- fusion_claims: authorizer number shown on OT/PT contact form
- fusion_so_to_po: added x_marked_for (Many2one) field definition on purchase.order
- fusion_so_to_po: added x_fc_account_number on res.partner for vendor account numbers
2026-03-11 17:22:02 +00:00

86 lines
3.1 KiB
Python

# -*- 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',
tracking=True,
help='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,
)
# ==========================================================================
# AUTHORIZER FIELDS
# ==========================================================================
x_fc_authorizer_number = fields.Char(
string='ADP Authorizer Number',
tracking=True,
index=True,
help='ADP Registration Number for this authorizer (e.g. OT). '
'Used to auto-link authorizers when processing ADP XML files.',
)
@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'