feat: separate fusion field service and LTC into standalone modules, update core modules

- fusion_claims: separated field service logic, updated controllers/views
- fusion_tasks: updated task views and map integration
- fusion_authorizer_portal: added page 11 signing, schedule booking, migrations
- fusion_shipping: new standalone shipping module (Canada Post, FedEx, DHL, Purolator)
- fusion_ltc_management: new standalone LTC management module
This commit is contained in:
2026-03-11 16:19:52 +00:00
parent 1f79cdcaaf
commit 431052920e
274 changed files with 52782 additions and 7302 deletions

View File

@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ================================================================== -->
<!-- CLEANUP - FORM VIEW -->
<!-- ================================================================== -->
<record id="view_ltc_cleanup_form" model="ir.ui.view">
<field name="name">fusion.ltc.cleanup.form</field>
<field name="model">fusion.ltc.cleanup</field>
<field name="arch" type="xml">
<form string="Cleanup Schedule">
<header>
<button name="action_start" type="object" string="Start"
class="btn-primary"
invisible="state != 'scheduled'"/>
<button name="action_complete" type="object" string="Complete"
class="btn-primary"
invisible="state != 'in_progress'"/>
<button name="action_cancel" type="object" string="Cancel"
invisible="state in ('completed', 'cancelled')"/>
<button name="action_reset" type="object" string="Reset to Scheduled"
invisible="state not in ('cancelled', 'rescheduled')"/>
<field name="state" widget="statusbar"
statusbar_visible="scheduled,in_progress,completed"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_create_task" type="object"
class="oe_stat_button" icon="fa-tasks">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Task</span>
</div>
</button>
</div>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<group>
<group string="Schedule">
<field name="facility_id"/>
<field name="scheduled_date"/>
<field name="completed_date"/>
<field name="technician_id"/>
</group>
<group string="Details">
<field name="items_cleaned"/>
<field name="task_id" readonly="1"/>
</group>
</group>
<notebook>
<page string="Notes" name="notes">
<field name="notes" placeholder="Cleanup notes..."/>
</page>
<page string="Photos" name="photos">
<field name="photo_ids" widget="many2many_binary"/>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<!-- ================================================================== -->
<!-- CLEANUP - LIST VIEW -->
<!-- ================================================================== -->
<record id="view_ltc_cleanup_list" model="ir.ui.view">
<field name="name">fusion.ltc.cleanup.list</field>
<field name="model">fusion.ltc.cleanup</field>
<field name="arch" type="xml">
<list string="Cleanup Schedule" default_order="scheduled_date desc"
decoration-success="state == 'completed'"
decoration-muted="state in ('cancelled', 'rescheduled')">
<field name="name"/>
<field name="facility_id"/>
<field name="scheduled_date"/>
<field name="completed_date" optional="show"/>
<field name="technician_id" widget="many2one_avatar_user" optional="show"/>
<field name="items_cleaned" optional="show"/>
<field name="state" widget="badge"
decoration-info="state == 'scheduled'"
decoration-warning="state == 'in_progress'"
decoration-success="state == 'completed'"
decoration-danger="state == 'cancelled'"
decoration-muted="state == 'rescheduled'"/>
</list>
</field>
</record>
<!-- ================================================================== -->
<!-- CLEANUP - KANBAN VIEW -->
<!-- ================================================================== -->
<record id="view_ltc_cleanup_kanban" model="ir.ui.view">
<field name="name">fusion.ltc.cleanup.kanban</field>
<field name="model">fusion.ltc.cleanup</field>
<field name="arch" type="xml">
<kanban default_group_by="state" class="o_kanban_small_column">
<templates>
<t t-name="card">
<div class="d-flex justify-content-between">
<field name="name" class="fw-bold"/>
</div>
<div>
<field name="facility_id" class="fw-bold"/>
</div>
<div class="text-muted">
Scheduled: <field name="scheduled_date"/>
</div>
<div t-if="record.completed_date.raw_value" class="text-muted">
Completed: <field name="completed_date"/>
</div>
<footer class="mt-2">
<field name="technician_id" widget="many2one_avatar_user"/>
</footer>
</t>
</templates>
</kanban>
</field>
</record>
<!-- ================================================================== -->
<!-- CLEANUP - SEARCH VIEW -->
<!-- ================================================================== -->
<record id="view_ltc_cleanup_search" model="ir.ui.view">
<field name="name">fusion.ltc.cleanup.search</field>
<field name="model">fusion.ltc.cleanup</field>
<field name="arch" type="xml">
<search string="Search Cleanups">
<field name="facility_id"/>
<field name="technician_id"/>
<separator/>
<filter string="Scheduled" name="filter_scheduled"
domain="[('state', '=', 'scheduled')]"/>
<filter string="In Progress" name="filter_in_progress"
domain="[('state', '=', 'in_progress')]"/>
<filter string="Completed" name="filter_completed"
domain="[('state', '=', 'completed')]"/>
<separator/>
<filter string="Upcoming (7 Days)" name="filter_upcoming"
domain="[('scheduled_date', '&lt;=', (context_today() + datetime.timedelta(days=7)).strftime('%Y-%m-%d')),
('scheduled_date', '>=', context_today().strftime('%Y-%m-%d')),
('state', '=', 'scheduled')]"/>
<filter string="Overdue" name="filter_overdue"
domain="[('scheduled_date', '&lt;', context_today().strftime('%Y-%m-%d')),
('state', '=', 'scheduled')]"/>
<separator/>
<filter string="Facility" name="group_facility"
context="{'group_by': 'facility_id'}"/>
<filter string="Status" name="group_state"
context="{'group_by': 'state'}"/>
<filter string="Technician" name="group_technician"
context="{'group_by': 'technician_id'}"/>
<filter string="Scheduled Month" name="group_month"
context="{'group_by': 'scheduled_date:month'}"/>
</search>
</field>
</record>
<!-- ================================================================== -->
<!-- ACTIONS -->
<!-- ================================================================== -->
<record id="action_ltc_cleanups" model="ir.actions.act_window">
<field name="name">Cleanup Schedule</field>
<field name="res_model">fusion.ltc.cleanup</field>
<field name="view_mode">list,kanban,form</field>
<field name="search_view_id" ref="view_ltc_cleanup_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No cleanups scheduled yet
</p>
<p>Cleanups are auto-scheduled based on facility settings, or can be created manually.</p>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,299 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ================================================================== -->
<!-- FACILITY - FORM VIEW -->
<!-- ================================================================== -->
<record id="view_ltc_facility_form" model="ir.ui.view">
<field name="name">fusion.ltc.facility.form</field>
<field name="model">fusion.ltc.facility</field>
<field name="arch" type="xml">
<form string="LTC Facility">
<header/>
<sheet>
<widget name="web_ribbon" text="Archived" bg_color="text-bg-danger"
invisible="active"/>
<field name="active" invisible="1"/>
<div class="oe_button_box" name="button_box">
<button name="action_view_repairs" type="object"
class="oe_stat_button" icon="fa-wrench">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="active_repair_count"/>
</span>
<span class="o_stat_text">Active Repairs</span>
</div>
</button>
<button name="action_view_repairs" type="object"
class="oe_stat_button" icon="fa-list">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="repair_count"/>
</span>
<span class="o_stat_text">Total Repairs</span>
</div>
</button>
<button name="action_view_cleanups" type="object"
class="oe_stat_button" icon="fa-refresh">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="cleanup_count"/>
</span>
<span class="o_stat_text">Cleanups</span>
</div>
</button>
</div>
<field name="image_1920" widget="image" class="oe_avatar"
options="{'preview_image': 'image_128'}"/>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name" placeholder="Facility Name"/>
</h1>
<field name="code" readonly="1"/>
</div>
<group>
<group string="Facility Details">
<field name="partner_id"/>
<field name="phone" widget="phone"/>
<field name="email" widget="email"/>
<field name="website" widget="url"/>
</group>
<group string="Address">
<field name="street"/>
<field name="street2"/>
<field name="city"/>
<field name="state_id"/>
<field name="zip"/>
<field name="country_id"/>
</group>
</group>
<notebook>
<page string="Key Contacts" name="contacts">
<group>
<group>
<field name="director_of_care_id"/>
<field name="service_supervisor_id"/>
</group>
<group>
<field name="physiotherapist_ids" widget="many2many_tags"/>
</group>
</group>
</page>
<page string="Floors &amp; Stations" name="structure">
<group>
<field name="number_of_floors"/>
</group>
<field name="floor_ids">
<list editable="bottom">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="head_nurse_id"/>
<field name="physiotherapist_id"/>
</list>
</field>
</page>
<page string="Nursing Stations" name="stations">
<field name="floor_ids" mode="list">
<list>
<field name="name" string="Floor"/>
<field name="station_ids" widget="many2many_tags" string="Stations"/>
<field name="head_nurse_id"/>
</list>
</field>
</page>
<page string="Contract" name="contract">
<group>
<group>
<field name="contract_start_date"/>
<field name="contract_end_date"/>
</group>
<group>
<field name="cleanup_frequency"/>
<field name="cleanup_interval_days"
invisible="cleanup_frequency != 'custom'"/>
<field name="next_cleanup_date"/>
</group>
</group>
<separator string="Contract Document"/>
<div class="row mb-3">
<div class="col-md-6">
<div class="d-flex align-items-center gap-2">
<field name="contract_file"
filename="contract_file_filename"
widget="binary" nolabel="1"/>
<field name="contract_file_filename" invisible="1"/>
<button name="action_preview_contract" type="object"
class="btn btn-secondary"
icon="fa-eye"
string="Preview"
invisible="not contract_file"/>
</div>
</div>
</div>
<field name="contract_notes" placeholder="Contract details and notes..."/>
</page>
<page string="Notes" name="notes">
<field name="notes"/>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<!-- ================================================================== -->
<!-- FACILITY - LIST VIEW -->
<!-- ================================================================== -->
<record id="view_ltc_facility_list" model="ir.ui.view">
<field name="name">fusion.ltc.facility.list</field>
<field name="model">fusion.ltc.facility</field>
<field name="arch" type="xml">
<list default_order="name">
<field name="code" optional="show"/>
<field name="name"/>
<field name="city"/>
<field name="phone" optional="show"/>
<field name="director_of_care_id" optional="show"/>
<field name="service_supervisor_id" optional="hide"/>
<field name="number_of_floors" optional="hide"/>
<field name="contract_start_date" optional="hide"/>
<field name="contract_end_date" optional="hide"/>
<field name="cleanup_frequency" optional="show"/>
<field name="next_cleanup_date" optional="show"/>
</list>
</field>
</record>
<!-- ================================================================== -->
<!-- FACILITY - SEARCH VIEW -->
<!-- ================================================================== -->
<record id="view_ltc_facility_search" model="ir.ui.view">
<field name="name">fusion.ltc.facility.search</field>
<field name="model">fusion.ltc.facility</field>
<field name="arch" type="xml">
<search string="Search Facilities">
<field name="name" string="Facility"/>
<field name="code"/>
<field name="city"/>
<field name="director_of_care_id"/>
<separator/>
<filter string="Active" name="filter_active"
domain="[('active', '=', True)]"/>
<filter string="Archived" name="filter_archived"
domain="[('active', '=', False)]"/>
<separator/>
<filter string="Has Repairs" name="filter_has_repairs"
domain="[('repair_ids', '!=', False)]"/>
<filter string="Cleanup Due" name="filter_cleanup_due"
domain="[('next_cleanup_date', '&lt;=', (context_today() + datetime.timedelta(days=7)).strftime('%Y-%m-%d')),
('next_cleanup_date', '!=', False)]"/>
<separator/>
<filter string="City" name="group_city" context="{'group_by': 'city'}"/>
<filter string="Cleanup Frequency" name="group_frequency"
context="{'group_by': 'cleanup_frequency'}"/>
</search>
</field>
</record>
<!-- ================================================================== -->
<!-- STATION - FORM VIEW (for inline editing within floors) -->
<!-- ================================================================== -->
<record id="view_ltc_station_form" model="ir.ui.view">
<field name="name">fusion.ltc.station.form</field>
<field name="model">fusion.ltc.station</field>
<field name="arch" type="xml">
<form string="Nursing Station">
<sheet>
<group>
<group>
<field name="name"/>
<field name="sequence"/>
</group>
<group>
<field name="head_nurse_id"/>
<field name="phone" widget="phone"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<!-- ================================================================== -->
<!-- STATION - LIST VIEW -->
<!-- ================================================================== -->
<record id="view_ltc_station_list" model="ir.ui.view">
<field name="name">fusion.ltc.station.list</field>
<field name="model">fusion.ltc.station</field>
<field name="arch" type="xml">
<list string="Nursing Stations" editable="bottom">
<field name="sequence" widget="handle"/>
<field name="floor_id"/>
<field name="name"/>
<field name="head_nurse_id"/>
<field name="phone"/>
</list>
</field>
</record>
<!-- ================================================================== -->
<!-- FLOOR - FORM VIEW (with embedded stations) -->
<!-- ================================================================== -->
<record id="view_ltc_floor_form" model="ir.ui.view">
<field name="name">fusion.ltc.floor.form</field>
<field name="model">fusion.ltc.floor</field>
<field name="arch" type="xml">
<form string="Floor">
<sheet>
<group>
<group>
<field name="name"/>
<field name="sequence"/>
<field name="facility_id" invisible="1"/>
</group>
<group>
<field name="head_nurse_id"/>
<field name="physiotherapist_id"/>
</group>
</group>
<field name="station_ids">
<list editable="bottom">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="head_nurse_id"/>
<field name="phone"/>
</list>
</field>
</sheet>
</form>
</field>
</record>
<!-- ================================================================== -->
<!-- ACTIONS -->
<!-- ================================================================== -->
<record id="action_ltc_facilities" model="ir.actions.act_window">
<field name="name">LTC Facilities</field>
<field name="res_model">fusion.ltc.facility</field>
<field name="view_mode">list,form</field>
<field name="search_view_id" ref="view_ltc_facility_search"/>
<field name="context">{'search_default_filter_active': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Add your first LTC Facility
</p>
<p>Create a facility record to start managing repairs and cleanups.</p>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ================================================================== -->
<!-- FORM SUBMISSION - LIST VIEW -->
<!-- ================================================================== -->
<record id="view_ltc_form_submission_list" model="ir.ui.view">
<field name="name">fusion.ltc.form.submission.list</field>
<field name="model">fusion.ltc.form.submission</field>
<field name="arch" type="xml">
<list string="Form Submissions" default_order="submitted_date desc"
decoration-danger="is_emergency"
decoration-info="status == 'submitted'"
decoration-success="status == 'processed'">
<field name="name"/>
<field name="form_type"/>
<field name="facility_id"/>
<field name="client_name"/>
<field name="room_number"/>
<field name="product_serial" optional="show"/>
<field name="is_emergency"/>
<field name="submitted_date"/>
<field name="ip_address" optional="hide"/>
<field name="repair_id" optional="show"/>
<field name="status" widget="badge"
decoration-info="status == 'submitted'"
decoration-success="status == 'processed'"
decoration-danger="status == 'rejected'"/>
</list>
</field>
</record>
<!-- ================================================================== -->
<!-- FORM SUBMISSION - FORM VIEW -->
<!-- ================================================================== -->
<record id="view_ltc_form_submission_form" model="ir.ui.view">
<field name="name">fusion.ltc.form.submission.form</field>
<field name="model">fusion.ltc.form.submission</field>
<field name="arch" type="xml">
<form string="Form Submission">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_view_repair" type="object"
class="oe_stat_button" icon="fa-wrench"
invisible="not repair_id">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Repair</span>
</div>
</button>
</div>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<group>
<group>
<field name="form_type"/>
<field name="facility_id"/>
<field name="client_name"/>
<field name="room_number"/>
<field name="product_serial"/>
<field name="is_emergency"/>
</group>
<group>
<field name="status"/>
<field name="submitted_date"/>
<field name="ip_address"/>
<field name="repair_id"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<!-- ================================================================== -->
<!-- FORM SUBMISSION - SEARCH VIEW -->
<!-- ================================================================== -->
<record id="view_ltc_form_submission_search" model="ir.ui.view">
<field name="name">fusion.ltc.form.submission.search</field>
<field name="model">fusion.ltc.form.submission</field>
<field name="arch" type="xml">
<search string="Search Submissions">
<field name="name"/>
<field name="client_name"/>
<field name="facility_id"/>
<field name="room_number"/>
<separator/>
<filter string="Emergency" name="filter_emergency"
domain="[('is_emergency', '=', True)]"/>
<separator/>
<filter string="Submitted" name="filter_submitted"
domain="[('status', '=', 'submitted')]"/>
<filter string="Processed" name="filter_processed"
domain="[('status', '=', 'processed')]"/>
<filter string="Rejected" name="filter_rejected"
domain="[('status', '=', 'rejected')]"/>
<separator/>
<filter string="Today" name="filter_today"
domain="[('submitted_date', '>=', (context_today()).strftime('%Y-%m-%d'))]"/>
<filter string="This Week" name="filter_week"
domain="[('submitted_date', '>=', (context_today() - datetime.timedelta(days=7)).strftime('%Y-%m-%d'))]"/>
<filter string="This Month" name="filter_month"
domain="[('submitted_date', '>=', (context_today()).strftime('%Y-%m-01'))]"/>
<separator/>
<filter string="Facility" name="group_facility"
context="{'group_by': 'facility_id'}"/>
<filter string="Form Type" name="group_type"
context="{'group_by': 'form_type'}"/>
<filter string="Status" name="group_status"
context="{'group_by': 'status'}"/>
<filter string="Submitted Date" name="group_date"
context="{'group_by': 'submitted_date:day'}"/>
</search>
</field>
</record>
<!-- ================================================================== -->
<!-- ACTIONS -->
<!-- ================================================================== -->
<record id="action_ltc_form_submissions" model="ir.actions.act_window">
<field name="name">Form Submissions</field>
<field name="res_model">fusion.ltc.form.submission</field>
<field name="view_mode">list,form</field>
<field name="search_view_id" ref="view_ltc_form_submission_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No form submissions yet
</p>
<p>Submissions from portal repair forms will appear here.</p>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,375 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ================================================================== -->
<!-- REPAIR - FORM VIEW -->
<!-- ================================================================== -->
<record id="view_ltc_repair_form" model="ir.ui.view">
<field name="name">fusion.ltc.repair.form</field>
<field name="model">fusion.ltc.repair</field>
<field name="arch" type="xml">
<form string="Repair Request">
<header>
<button name="action_create_sale_order" type="object"
string="Create Sale Order" class="btn-primary"
invisible="sale_order_id"/>
<field name="stage_id" widget="statusbar"
options="{'clickable': '1'}"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_view_sale_order" type="object"
class="oe_stat_button" icon="fa-shopping-cart"
invisible="not sale_order_id">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="sale_order_name"/>
</span>
<span class="o_stat_text">Sale Order</span>
</div>
</button>
<button name="action_view_task" type="object"
class="oe_stat_button" icon="fa-tasks"
invisible="not task_id">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Task</span>
</div>
</button>
</div>
<widget name="web_ribbon" text="Emergency" bg_color="text-bg-danger"
invisible="not is_emergency"/>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<group>
<group string="Repair Details">
<field name="facility_id"/>
<field name="client_id"/>
<field name="client_name" invisible="client_id"/>
<field name="room_number"/>
<field name="is_emergency"/>
<field name="priority" widget="priority"/>
</group>
<group string="Product &amp; Assignment">
<field name="product_serial"/>
<field name="product_id"/>
<field name="assigned_technician_id"/>
<field name="source"/>
</group>
</group>
<notebook>
<page string="Issue" name="issue">
<group>
<group>
<field name="issue_reported_date"/>
</group>
<group>
<field name="issue_fixed_date"/>
</group>
</group>
<label for="issue_description"/>
<field name="issue_description"
placeholder="Describe the issue in detail..."/>
<label for="resolution_description"/>
<field name="resolution_description"
placeholder="How was the issue resolved?"/>
</page>
<page string="Family/POA" name="poa">
<group>
<group>
<field name="poa_name"/>
<field name="poa_phone" widget="phone"/>
</group>
</group>
</page>
<page string="Financial" name="financial">
<group>
<group>
<field name="sale_order_id"/>
<field name="task_id"/>
</group>
<group>
<field name="currency_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="repair_value"/>
</group>
</group>
</page>
<page string="Photos &amp; Notes" name="photos">
<div class="fc-gallery-content">
<separator string="Before Photos (Reported Condition)"/>
<field name="before_photo_ids" widget="many2many_binary"/>
<separator string="After Photos (Completed Repair)"/>
<field name="after_photo_ids" widget="many2many_binary"/>
</div>
<field name="photo_ids" invisible="1"/>
<separator string="Internal Notes"/>
<field name="notes" placeholder="Internal notes..."/>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<!-- ================================================================== -->
<!-- REPAIR - KANBAN VIEW -->
<!-- ================================================================== -->
<record id="view_ltc_repair_kanban" model="ir.ui.view">
<field name="name">fusion.ltc.repair.kanban</field>
<field name="model">fusion.ltc.repair</field>
<field name="arch" type="xml">
<kanban default_group_by="stage_id"
default_order="is_emergency desc, issue_reported_date desc"
highlight_color="color"
class="o_kanban_small_column">
<field name="color"/>
<field name="is_emergency"/>
<field name="stage_id"/>
<field name="kanban_state"/>
<field name="stage_color"/>
<progressbar field="kanban_state"
colors='{"normal": "200", "done": "success", "blocked": "danger"}'/>
<templates>
<t t-name="menu">
<a t-if="widget.editable" role="menuitem" type="open"
class="dropdown-item">Edit</a>
<a t-if="widget.deletable" role="menuitem" type="delete"
class="dropdown-item">Delete</a>
<field widget="kanban_color_picker" name="color"/>
</t>
<t t-name="card" class="flex-row">
<main t-att-data-stage="record.stage_color.raw_value || 'secondary'"
t-att-data-emergency="record.is_emergency.raw_value ? '1' : '0'"
t-att-data-priority="record.priority.raw_value">
<div class="d-flex justify-content-between align-items-center">
<field name="name" class="fw-bold text-primary"/>
<span t-attf-style="#{record.priority.raw_value == '1' ? 'background: rgba(255,152,0,0.1); border-radius: 4px; padding: 1px 5px;' : ''}">
<field name="priority" widget="priority"/>
</span>
</div>
<div class="mt-1">
<span class="fw-bold">
<field name="display_client_name"/>
</span>
<span t-if="record.room_number.raw_value"
class="ms-1 badge text-bg-light">
Rm <field name="room_number"/>
</span>
</div>
<div class="text-muted small">
<field name="facility_id"/>
</div>
<div t-if="record.is_emergency.raw_value"
class="mt-1">
<span class="badge text-bg-danger">
<i class="fa fa-exclamation-triangle me-1"/>Emergency
</span>
</div>
<div t-if="record.product_serial.raw_value"
class="text-muted small mt-1">
<i class="fa fa-barcode me-1"/>S/N: <field name="product_serial"/>
</div>
<footer class="mt-2 pt-1 border-top">
<span class="text-muted small">
<i class="fa fa-calendar me-1"/><field name="issue_reported_date"/>
</span>
<div class="ms-auto d-flex align-items-center">
<field name="kanban_state" widget="state_selection"/>
<field name="assigned_technician_id"
widget="many2one_avatar_user"
class="ms-1"/>
</div>
</footer>
</main>
</t>
</templates>
</kanban>
</field>
</record>
<!-- ================================================================== -->
<!-- REPAIR - LIST VIEW -->
<!-- ================================================================== -->
<record id="view_ltc_repair_list" model="ir.ui.view">
<field name="name">fusion.ltc.repair.list</field>
<field name="model">fusion.ltc.repair</field>
<field name="arch" type="xml">
<list string="Repair Requests" default_order="issue_reported_date desc"
decoration-danger="is_emergency">
<field name="stage_color" column_invisible="1"/>
<field name="name"/>
<field name="facility_id"/>
<field name="display_client_name" string="Client"/>
<field name="room_number"/>
<field name="product_serial" optional="show"/>
<field name="issue_reported_date"/>
<field name="issue_fixed_date" optional="show"/>
<field name="stage_id" widget="badge"
decoration-info="stage_color == 'info'"
decoration-warning="stage_color == 'warning'"
decoration-success="stage_color == 'success'"
decoration-danger="stage_color == 'danger'"
optional="show"/>
<field name="is_emergency" string="Emergency" optional="show"
widget="boolean_toggle"/>
<field name="assigned_technician_id" widget="many2one_avatar_user"
optional="show"/>
<field name="sale_order_id" optional="hide"/>
<field name="repair_value" optional="hide"/>
<field name="source" optional="hide"/>
</list>
</field>
</record>
<!-- ================================================================== -->
<!-- REPAIR - SEARCH VIEW -->
<!-- ================================================================== -->
<record id="view_ltc_repair_search" model="ir.ui.view">
<field name="name">fusion.ltc.repair.search</field>
<field name="model">fusion.ltc.repair</field>
<field name="arch" type="xml">
<search string="Search Repairs">
<field name="name"/>
<field name="display_client_name" string="Client"/>
<field name="room_number"/>
<field name="product_serial"/>
<field name="facility_id"/>
<field name="assigned_technician_id"/>
<separator/>
<filter string="Emergency" name="filter_emergency"
domain="[('is_emergency', '=', True)]"/>
<separator/>
<filter string="New" name="filter_new"
domain="[('stage_id.sequence', '=', 1)]"/>
<filter string="In Progress" name="filter_in_progress"
domain="[('stage_id.fold', '=', False), ('stage_id.sequence', '>', 1)]"/>
<filter string="Completed" name="filter_completed"
domain="[('stage_id.fold', '=', True)]"/>
<separator/>
<filter string="Has Sale Order" name="filter_has_so"
domain="[('sale_order_id', '!=', False)]"/>
<filter string="No Sale Order" name="filter_no_so"
domain="[('sale_order_id', '=', False)]"/>
<separator/>
<filter string="This Month" name="filter_this_month"
domain="[('issue_reported_date', '>=', (context_today()).strftime('%Y-%m-01'))]"/>
<filter string="Last 30 Days" name="filter_30d"
domain="[('issue_reported_date', '>=', (context_today() - datetime.timedelta(days=30)).strftime('%Y-%m-%d'))]"/>
<filter string="This Year" name="filter_this_year"
domain="[('issue_reported_date', '>=', (context_today()).strftime('%Y-01-01'))]"/>
<separator/>
<filter string="Facility" name="group_facility"
context="{'group_by': 'facility_id'}"/>
<filter string="Stage" name="group_stage"
context="{'group_by': 'stage_id'}"/>
<filter string="Technician" name="group_technician"
context="{'group_by': 'assigned_technician_id'}"/>
<filter string="Source" name="group_source"
context="{'group_by': 'source'}"/>
<filter string="Reported Month" name="group_month"
context="{'group_by': 'issue_reported_date:month'}"/>
<filter string="Fixed Month" name="group_fixed_month"
context="{'group_by': 'issue_fixed_date:month'}"/>
</search>
</field>
</record>
<!-- ================================================================== -->
<!-- REPAIR STAGE - LIST + FORM (Configuration) -->
<!-- ================================================================== -->
<record id="view_ltc_repair_stage_list" model="ir.ui.view">
<field name="name">fusion.ltc.repair.stage.list</field>
<field name="model">fusion.ltc.repair.stage</field>
<field name="arch" type="xml">
<list string="Repair Stages" editable="bottom">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="color"/>
<field name="fold"/>
<field name="description" optional="hide"/>
</list>
</field>
</record>
<record id="view_ltc_repair_stage_form" model="ir.ui.view">
<field name="name">fusion.ltc.repair.stage.form</field>
<field name="model">fusion.ltc.repair.stage</field>
<field name="arch" type="xml">
<form string="Repair Stage">
<sheet>
<group>
<field name="name"/>
<field name="sequence"/>
<field name="color"/>
<field name="fold"/>
<field name="description"/>
</group>
</sheet>
</form>
</field>
</record>
<!-- ================================================================== -->
<!-- ACTIONS -->
<!-- ================================================================== -->
<record id="action_ltc_repairs_kanban" model="ir.actions.act_window">
<field name="name">Repair Overview</field>
<field name="res_model">fusion.ltc.repair</field>
<field name="view_mode">kanban,list,form</field>
<field name="search_view_id" ref="view_ltc_repair_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No repair requests yet
</p>
<p>Repair requests submitted via the portal form or manually will appear here.</p>
</field>
</record>
<record id="action_ltc_repairs_all" model="ir.actions.act_window">
<field name="name">All Repairs</field>
<field name="res_model">fusion.ltc.repair</field>
<field name="view_mode">kanban,list,form</field>
<field name="search_view_id" ref="view_ltc_repair_search"/>
</record>
<record id="action_ltc_repairs_new" model="ir.actions.act_window">
<field name="name">New / Pending</field>
<field name="res_model">fusion.ltc.repair</field>
<field name="view_mode">kanban,list,form</field>
<field name="search_view_id" ref="view_ltc_repair_search"/>
<field name="domain">[('stage_id.sequence', '&lt;=', 2)]</field>
</record>
<record id="action_ltc_repairs_in_progress" model="ir.actions.act_window">
<field name="name">In Progress</field>
<field name="res_model">fusion.ltc.repair</field>
<field name="view_mode">kanban,list,form</field>
<field name="search_view_id" ref="view_ltc_repair_search"/>
<field name="domain">[('stage_id.fold', '=', False), ('stage_id.sequence', '>', 2)]</field>
</record>
<record id="action_ltc_repairs_completed" model="ir.actions.act_window">
<field name="name">Completed</field>
<field name="res_model">fusion.ltc.repair</field>
<field name="view_mode">kanban,list,form</field>
<field name="search_view_id" ref="view_ltc_repair_search"/>
<field name="domain">[('stage_id.fold', '=', True)]</field>
</record>
<record id="action_ltc_repair_stages" model="ir.actions.act_window">
<field name="name">Repair Stages</field>
<field name="res_model">fusion.ltc.repair.stage</field>
<field name="view_mode">list,form</field>
</record>
</odoo>

View File

@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ================================================================== -->
<!-- ROOT MENU (Application) -->
<!-- ================================================================== -->
<menuitem id="menu_ltc_root"
name="LTC Management"
web_icon="fusion_ltc_management,static/description/icon.png"
sequence="45"
groups="sales_team.group_sale_salesman"/>
<!-- ================================================================== -->
<!-- OVERVIEW -->
<!-- ================================================================== -->
<menuitem id="menu_ltc_overview"
name="Overview"
parent="menu_ltc_root"
action="action_ltc_repairs_kanban"
sequence="1"/>
<!-- ================================================================== -->
<!-- REPAIR REQUESTS -->
<!-- ================================================================== -->
<menuitem id="menu_ltc_repairs"
name="Repair Requests"
parent="menu_ltc_root"
sequence="10"/>
<menuitem id="menu_ltc_repairs_all"
name="All Repairs"
parent="menu_ltc_repairs"
action="action_ltc_repairs_all"
sequence="1"/>
<menuitem id="menu_ltc_repairs_new"
name="New / Pending"
parent="menu_ltc_repairs"
action="action_ltc_repairs_new"
sequence="2"/>
<menuitem id="menu_ltc_repairs_progress"
name="In Progress"
parent="menu_ltc_repairs"
action="action_ltc_repairs_in_progress"
sequence="3"/>
<menuitem id="menu_ltc_repairs_completed"
name="Completed"
parent="menu_ltc_repairs"
action="action_ltc_repairs_completed"
sequence="4"/>
<!-- ================================================================== -->
<!-- CLEANUP SCHEDULE -->
<!-- ================================================================== -->
<menuitem id="menu_ltc_cleanup"
name="Cleanup Schedule"
parent="menu_ltc_root"
action="action_ltc_cleanups"
sequence="20"/>
<!-- ================================================================== -->
<!-- LOCATIONS -->
<!-- ================================================================== -->
<menuitem id="menu_ltc_locations"
name="Locations"
parent="menu_ltc_root"
sequence="30"/>
<menuitem id="menu_ltc_facilities"
name="Facilities"
parent="menu_ltc_locations"
action="action_ltc_facilities"
sequence="1"/>
<!-- ================================================================== -->
<!-- FORM SUBMISSIONS -->
<!-- ================================================================== -->
<menuitem id="menu_ltc_form_submissions"
name="Form Submissions"
parent="menu_ltc_root"
action="action_ltc_form_submissions"
sequence="40"/>
<!-- ================================================================== -->
<!-- CONFIGURATION -->
<!-- ================================================================== -->
<menuitem id="menu_ltc_config"
name="Configuration"
parent="menu_ltc_root"
sequence="90"
groups="sales_team.group_sale_manager"/>
<menuitem id="menu_ltc_repair_stages"
name="Repair Stages"
parent="menu_ltc_config"
action="action_ltc_repair_stages"
sequence="1"/>
</odoo>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form_ltc" model="ir.ui.view">
<field name="name">res.config.settings.view.form.ltc</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<app data-string="LTC Management" string="LTC Management"
data-key="fusion_ltc_management">
<block title="Portal Forms">
<setting string="LTC Form Access Password"
help="Set a password to protect the public LTC repair form. Share this with facility staff so they can submit repair requests. Minimum 4 characters. Leave empty to allow unrestricted access.">
<field name="fc_ltc_form_password"
placeholder="e.g. 1234"/>
</setting>
</block>
</app>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Add LTC Home tab to Partner Form -->
<record id="view_partner_form_ltc" model="ir.ui.view">
<field name="name">res.partner.form.ltc</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page string="LTC Home" name="ltc_info"
invisible="x_fc_contact_type not in ('long_term_care_home',)">
<group string="LTC Facility Information">
<group>
<field name="x_fc_ltc_facility_id"/>
<field name="x_fc_ltc_room_number"/>
</group>
</group>
<group string="Family Contacts">
<field name="x_fc_ltc_family_contact_ids" nolabel="1">
<list editable="bottom">
<field name="name"/>
<field name="relationship"/>
<field name="phone"/>
<field name="phone2"/>
<field name="email"/>
<field name="is_poa"/>
<field name="notes" optional="hide"/>
</list>
</field>
</group>
</page>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Add LTC Repair fields to Sale Order form -->
<record id="view_order_form_ltc" model="ir.ui.view">
<field name="name">sale.order.form.ltc</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="x_fc_ltc_repair_id" invisible="not x_fc_is_ltc_repair_sale"/>
<field name="x_fc_is_ltc_repair_sale" invisible="1"/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Add facility_id to technician task form -->
<record id="view_technician_task_form_ltc" model="ir.ui.view">
<field name="name">fusion.technician.task.form.ltc</field>
<field name="model">fusion.technician.task</field>
<field name="inherit_id" ref="fusion_tasks.view_technician_task_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='priority']" position="after">
<field name="facility_id"
invisible="task_type != 'ltc_visit'"/>
</xpath>
</field>
</record>
</odoo>