# -*- coding: utf-8 -*- # Copyright 2024-2026 Nexa Systems Inc. # License OPL-1 (Odoo Proprietary License v1.0) from odoo import fields, models class ResUsers(models.Model): """Extends res.users with fusion_repairs specific fields. Reuses the existing x_fc_is_field_staff Boolean from fusion_tasks as the technician flag - do NOT recreate that field here. All technician selectors in fusion_repairs use the same domain [('x_fc_is_field_staff', '=', True)] for consistency with fusion_tasks. """ _inherit = 'res.users' x_fc_repair_skills = fields.Many2many( 'fusion.repair.product.category', 'fusion_repair_user_skill_rel', 'user_id', 'category_id', string='Repair Skills', help='Medical equipment categories this user is qualified to service. ' 'Used by dispatcher to filter candidate technicians for a repair.', ) x_fc_tech_cost_rate = fields.Monetary( string='Tech Cost Rate (/h)', currency_field='company_currency_id', help='Internal cost per hour - used for repair margin calculation (Phase 4).', ) # On-call rotation - Phase 2 (simple priority-int approach). x_fc_on_call = fields.Boolean( string='On-Call Eligible', help='Tick if this user is eligible for the weekend / after-hours on-call rotation.', ) x_fc_on_call_priority = fields.Integer( string='On-Call Priority', default=99, help='Lower number = paged first. The escalation cron picks the lowest priority ' 'available user when a safety repair is submitted after hours.', ) x_fc_on_call_phone = fields.Char( string='On-Call Phone Override', help='Phone number to use for on-call SMS / calls. If empty, falls back to ' 'the user partner phone.', ) company_currency_id = fields.Many2one( 'res.currency', related='company_id.currency_id', readonly=True, )