Scaffolds the fusion_repairs module that extends Odoo 19 repair.order with a guided medical-equipment intake workflow. Models - fusion.repair.product.category (8 medical equipment categories seeded) - fusion.repair.intake.template / .question / .answer (7 templates, 32 questions seeded across hospital bed, stairlift, porch lift, wheelchair, walker/rollator, mattress) - fusion.repair.intake.service (AbstractModel) - single entry point used by backend wizard, sales rep portal, and public client portal so all three surfaces produce identical outcomes - repair.order extensions (x_fc_intake_*, x_fc_third_party_equipment, x_fc_photo_ids, x_fc_urgency, x_fc_estimated/actual_cost, AI summary) - fusion.technician.task back-link (x_fc_repair_order_id) - res.partner service preferences (preferred tech, time window, access notes) - res.users repair extensions (skills, cost rate, on-call rotation fields) - res.config.settings for variance thresholds, portal URL, rate limit UI - Backend intake wizard with multi-equipment loop, third-party flag, photos - repair.order form: Intake tab, Photos, Pricing tab, AI tab, smart buttons (technician tasks, intake answers, original SO) - Kanban + list view urgency badges - Fusion Repairs app menu (New Service Call, Repair Orders, Config) Activities & Email - 4 follow-up activity types (CS callback, tech dispatch, visit follow-up, manager review) with urgency-tiered deadlines - 2 mail templates (client confirmation + office notification) with the same dark/light-safe styling as fusion_claims ADP templates Security - New res.groups.privilege + 3 groups (User, Dispatcher, Manager) - Reuses fusion_tasks.group_field_technician (do NOT recreate) - Reuses fusion_authorizer_portal.group_sales_rep_portal - Multi-company global rule + technician scoping rule on repair.order Verified end-to-end on local westin-v19 dev DB via odoo-shell - creates multiple repairs in one session, auto-creates dispatch task for urgent, attaches 4 activity types correctly per urgency tier and third-party flag. Co-authored-by: Cursor <cursoragent@cursor.com>
58 lines
2.0 KiB
Python
58 lines
2.0 KiB
Python
# -*- 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,
|
|
)
|