Files
Odoo-Modules/fusion_repairs/models/res_config_settings.py
gsinghpal 429084e0bf feat(fusion_repairs): Phase 1 MVP - backend intake wizard + core models
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>
2026-05-20 21:35:52 -04:00

65 lines
2.6 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 ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
# NOTE: res.config.settings only supports boolean/integer/float/char/
# selection/many2one/datetime types per project Odoo 19 conventions.
fc_repairs_enable_email_notifications = fields.Boolean(
string='Enable Repair Email Notifications',
config_parameter='fusion_repairs.enable_email_notifications',
default=True,
help='Master toggle for automated repair-related emails to clients and office.',
)
fc_repairs_outstanding_balance_threshold = fields.Float(
string='Outstanding Balance Warning ($)',
config_parameter='fusion_repairs.outstanding_balance_threshold',
default=100.0,
help='Show a warning banner during intake if the client has open invoices '
'totalling more than this amount.',
)
fc_repairs_duplicate_call_window_days = fields.Integer(
string='Duplicate Call Window (Days)',
config_parameter='fusion_repairs.duplicate_call_window_days',
default=14,
help='When the intake wizard finds an open repair from this many days back on '
'the same phone number, it offers "add note to existing repair instead".',
)
fc_repairs_variance_threshold_pct = fields.Integer(
string='Pricing Variance Threshold (%)',
config_parameter='fusion_repairs.variance_threshold_pct',
default=20,
help='If actual cost exceeds estimated cost by more than this percentage, '
'invoicing is blocked until a manager reviews / a re-quote email is sent.',
)
fc_repairs_variance_threshold_amount = fields.Float(
string='Pricing Variance Threshold ($)',
config_parameter='fusion_repairs.variance_threshold_amount',
default=100.0,
help='Absolute variance amount that also triggers re-quote (whichever hits first).',
)
fc_repairs_client_portal_url = fields.Char(
string='Public Client Portal URL Path',
config_parameter='fusion_repairs.client_portal_url',
default='/repair',
help='URL path mentioned in voicemail greetings and printed on QR stickers. '
'Phase 1 ships with the form at this path.',
)
fc_repairs_client_portal_rate_limit_per_hour = fields.Integer(
string='Client Portal Rate Limit (per hour, per IP)',
config_parameter='fusion_repairs.client_portal_rate_limit_per_hour',
default=10,
)