Initial commit

This commit is contained in:
gsinghpal
2026-02-22 01:22:18 -05:00
commit 5200d5baf0
2394 changed files with 386834 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2024-2025 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
Part of the Fusion Claim Assistant product family.
-->
<odoo>
<!-- Add "Requires Card Digits" checkbox to payment method lines in journal form -->
<record id="view_account_journal_form_fc" model="ir.ui.view">
<field name="name">account.journal.form.fc</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.view_account_journal_form"/>
<field name="arch" type="xml">
<!-- Add column to inbound payment methods -->
<xpath expr="//field[@name='inbound_payment_method_line_ids']/list/field[@name='name']" position="after">
<field name="x_fc_requires_card_digits" string="Req. Card #"
help="Check this box if this payment method requires the last 4 digits of the card"/>
</xpath>
<!-- Add column to outbound payment methods -->
<xpath expr="//field[@name='outbound_payment_method_line_ids']/list/field[@name='name']" position="after">
<field name="x_fc_requires_card_digits" string="Req. Card #"
help="Check this box if this payment method requires the last 4 digits of the card"/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,394 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2024-2025 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
Part of the Fusion Claim Assistant product family.
-->
<odoo>
<!-- ===================================================================== -->
<!-- INVOICE FORM: Header Fields -->
<!-- ===================================================================== -->
<record id="view_move_form_fusion_claims_header" model="ir.ui.view">
<field name="name">account.move.form.fusion.central.header</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="priority">50</field>
<field name="arch" type="xml">
<!-- Add hidden detection flags -->
<xpath expr="//field[@name='move_type']" position="after">
<field name="x_fc_is_adp_invoice" invisible="1"/>
<field name="x_fc_show_authorizer" invisible="1"/>
<field name="x_fc_show_authorizer_question" invisible="1"/>
</xpath>
<!-- Add Portion badge at the top (header area) for split invoices -->
<xpath expr="//div[hasclass('oe_title')]" position="before">
<div class="float-end" invisible="move_type not in ['out_invoice', 'out_refund'] or x_fc_adp_invoice_portion == 'full'">
<field name="x_fc_adp_invoice_portion" widget="badge" readonly="1"
decoration-info="x_fc_adp_invoice_portion == 'client'"
decoration-warning="x_fc_adp_invoice_portion == 'adp'"/>
</div>
</xpath>
<!-- Add Invoice Type, Authorizer Required?, Authorizer, Client Type after Journal div -->
<xpath expr="//div[@name='journal_div']" position="after">
<field name="x_fc_invoice_type" string="Invoice Type"
invisible="move_type not in ['out_invoice', 'out_refund']"/>
<!-- Authorizer Required? - only for odsp, direct_private, insurance, other, rental -->
<field name="x_fc_authorizer_required" string="Authorizer Required?"
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_show_authorizer_question"/>
<!-- Authorizer - shown based on invoice type and authorizer_required -->
<field name="x_fc_authorizer_id" string="Authorizer"
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_show_authorizer"
options="{'no_create': False, 'no_quick_create': False}"/>
<field name="x_fc_client_type" string="Client Type"
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice"/>
</xpath>
</field>
</record>
<!-- ===================================================================== -->
<!-- INVOICE FORM: Export Button, Sync Button, and Device Verification -->
<!-- ===================================================================== -->
<record id="view_move_form_fusion_claims_button" model="ir.ui.view">
<field name="name">account.move.form.fusion.central.button</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="priority">52</field>
<field name="arch" type="xml">
<!-- Add Export and Sync buttons to header -->
<xpath expr="//button[@name='button_draft']" position="after">
<field name="x_fc_is_adp_invoice" invisible="1"/>
<field name="x_fc_needs_device_verification" invisible="1"/>
<!-- Verify Device Approval button - only on client invoices that need verification -->
<button name="action_open_device_approval_wizard"
string="Verify Device Approval"
type="object"
class="btn-warning"
icon="fa-check-square-o"
invisible="not x_fc_needs_device_verification"
help="Complete device verification to enable ADP invoice creation"/>
<button name="action_sync_to_sale_order"
string="Sync All"
type="object"
class="btn-secondary"
icon="fa-refresh"
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice"
help="Sync ADP fields from this Invoice to the Sale Order and all linked invoices"/>
<button name="action_export_adp_claim"
string="Export ADP"
type="object"
class="btn-secondary"
icon="fa-file-text-o"
invisible="move_type not in ['out_invoice', 'out_refund'] or state != 'posted' or not x_fc_is_adp_invoice"/>
</xpath>
</field>
</record>
<!-- ===================================================================== -->
<!-- INVOICE FORM: ADP Billing Status Statusbar -->
<!-- ===================================================================== -->
<record id="view_move_form_fusion_claims_billing_status" model="ir.ui.view">
<field name="name">account.move.form.fusion.central.billing.status</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="priority">49</field>
<field name="arch" type="xml">
<!-- Add ADP Billing Status statusbar after the main header -->
<xpath expr="//header" position="inside">
<field name="x_fc_is_adp_invoice" invisible="1"/>
<field name="x_fc_is_mod_invoice" invisible="1"/>
<field name="x_fc_adp_billing_status" widget="statusbar" nolabel="1"
statusbar_visible="waiting,submitted,payment_issued"
clickable="1"
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice or x_fc_adp_invoice_portion != 'adp'"/>
<!-- Send to MOD button for March of Dimes invoices -->
<button name="action_mod_send_invoice" type="object"
string="Send to Case Worker" class="btn-primary" icon="fa-paper-plane"
invisible="move_type != 'out_invoice' or not x_fc_is_mod_invoice"
help="Send this invoice to the March of Dimes case worker"/>
</xpath>
</field>
</record>
<!-- ===================================================================== -->
<!-- INVOICE FORM: Device Verification Alert Banner -->
<!-- ===================================================================== -->
<record id="view_move_form_fusion_claims_verification_alert" model="ir.ui.view">
<field name="name">account.move.form.fusion.central.verification.alert</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="priority">51</field>
<field name="arch" type="xml">
<!-- Add verification alert banner at the top of the form -->
<xpath expr="//sheet" position="before">
<field name="x_fc_needs_device_verification" invisible="1"/>
<field name="x_fc_adp_invoice_portion" invisible="1"/>
<!-- Alert for client invoices needing device verification -->
<div class="alert alert-warning d-flex align-items-center" role="alert"
invisible="not x_fc_needs_device_verification">
<i class="fa fa-exclamation-triangle fa-2x me-3" title="Verification Pending"/>
<div>
<strong>Device Verification Pending</strong>
<p class="mb-0">
ADP funding approval verification is required before creating the ADP invoice.
Click <strong>Verify Device Approval</strong> to complete verification.
</p>
</div>
</div>
</xpath>
</field>
</record>
<!-- ===================================================================== -->
<!-- INVOICE FORM: ADP Case Details Tab -->
<!-- ===================================================================== -->
<record id="view_move_form_fusion_claims_adp_tab" model="ir.ui.view">
<field name="name">account.move.form.fusion.central.adp.tab</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="priority">55</field>
<field name="arch" type="xml">
<!-- Add ADP Case Details tab in notebook -->
<xpath expr="//notebook" position="inside">
<!-- Use computed x_fc_is_adp_invoice which checks BOTH Studio and module fields -->
<field name="x_fc_is_adp_invoice" invisible="1"/>
<page string="ADP Case Details" name="adp_case_details"
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice">
<group>
<group string="Claim Information">
<field name="x_fc_claim_number"/>
<field name="x_fc_client_ref_1"/>
<field name="x_fc_client_ref_2"/>
</group>
<group string="Dates">
<field name="x_fc_adp_delivery_date"/>
<field name="x_fc_service_start_date"/>
<field name="x_fc_service_end_date"/>
</group>
</group>
<group>
<group string="Export Status">
<field name="adp_exported" readonly="1"/>
<field name="adp_export_date" readonly="1" invisible="not adp_exported"/>
<field name="adp_export_count" readonly="1" invisible="not adp_exported"/>
</group>
</group>
<group invisible="x_fc_adp_invoice_portion != 'adp'">
<group string="ADP Billing Status">
<field name="x_fc_adp_billing_status"/>
</group>
</group>
</page>
</xpath>
</field>
</record>
<!-- ===================================================================== -->
<!-- INVOICE FORM: ADP Summary Tab -->
<!-- ===================================================================== -->
<record id="view_move_form_fusion_claims_tab" model="ir.ui.view">
<field name="name">account.move.form.fusion.central.tab</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="priority">60</field>
<field name="arch" type="xml">
<!-- Add ADP Summary tab in notebook -->
<xpath expr="//notebook" position="inside">
<!-- Use computed x_fc_is_adp_invoice which checks BOTH Studio and module fields -->
<page string="ADP Summary" name="adp_summary"
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice">
<!-- DEDUCTION ALERT - Only show when there are deductions -->
<field name="x_fc_has_deductions" invisible="1"/>
<field name="x_fc_total_deduction_amount" invisible="1"/>
<div class="alert alert-warning mb-3" role="alert" invisible="not x_fc_has_deductions">
<strong><i class="fa fa-minus-circle"/> Deductions Applied</strong>
<p class="mb-0">
ADP deductions have been applied to this invoice.
Total deduction impact: <strong><field name="x_fc_total_deduction_amount" widget="monetary" class="oe_inline"/></strong>
</p>
</div>
<group>
<group string="ADP Portion Breakdown">
<field name="x_fc_adp_portion_total" string="Total ADP Portion" widget="monetary"/>
<field name="x_fc_client_portion_total" string="Total Client Portion" widget="monetary"/>
</group>
<group string="Invoice Information">
<field name="x_fc_invoice_type" string="Invoice Type" readonly="1"/>
<field name="x_fc_client_type" string="Client Type" readonly="1"/>
</group>
</group>
<!-- Invoice line details for ADP Summary - filtered product lines with conditional deduction columns -->
<field name="x_fc_product_lines" mode="list" readonly="1" nolabel="1" class="w-100"
context="{'show_deductions': x_fc_has_deductions}">
<list string="Line Details" create="0" delete="0" limit="50"
decoration-success="x_fc_adp_approved"
decoration-danger="not x_fc_adp_approved and x_fc_adp_device_type"
decoration-warning="x_fc_deduction_type and x_fc_deduction_type != 'none'">
<field name="x_fc_adp_approved" string="✓" widget="boolean" width="40px"
help="Device approved by ADP"/>
<field name="name" string="Description" class="text-wrap"/>
<field name="x_fc_adp_device_type" string="Device Type" optional="show" width="150px"/>
<field name="x_fc_serial_number" string="S/N" optional="show" width="90px"/>
<field name="quantity" string="Qty" width="60px"/>
<field name="price_unit" string="Unit $" width="100px"/>
<field name="x_fc_deduction_type" string="Ded." width="70px"
column_invisible="not parent.x_fc_has_deductions"/>
<field name="x_fc_deduction_value" string="Ded.$" width="80px"
column_invisible="not parent.x_fc_has_deductions"/>
<field name="x_fc_adp_portion" string="ADP $" width="100px"/>
<field name="x_fc_client_portion" string="Client $" width="100px"/>
<field name="price_subtotal" string="Total" width="100px"/>
<field name="x_fc_device_placement" string="Plcmt" optional="hide" width="70px"/>
</list>
</field>
<div class="alert alert-info" role="alert">
<strong>Calculation Rules:</strong>
<ul>
<li><strong>REG Client:</strong> ADP Portion = 75%, Client Portion = 25%</li>
<li><strong>ODS/OWP/ACS/LTC/SEN/CCA:</strong> ADP Portion = 100%, Client Portion = 0%</li>
<li><strong>PCT Deduction:</strong> ADP pays X% of their normal portion</li>
<li><strong>AMT Deduction:</strong> Fixed $ amount deducted from ADP portion</li>
</ul>
<button name="action_recalculate_adp_portions" type="object"
string="Recalculate Portions" class="btn-primary"
help="Manually recalculate ADP and Client portions"/>
</div>
</page>
</xpath>
</field>
</record>
<!-- ===================================================================== -->
<!-- INVOICE LINE: Add S/N, ADP Portion, Client Portion columns -->
<!-- ===================================================================== -->
<record id="view_move_form_line_fusion_claims" model="ir.ui.view">
<field name="name">account.move.form.line.fusion.central</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="priority">65</field>
<field name="arch" type="xml">
<!-- Add serial number column right after product name/description - always visible for invoices -->
<xpath expr="//field[@name='invoice_line_ids']//field[@name='name']" position="after">
<field name="x_fc_serial_number" string="S/N" width="100px"
column_invisible="parent.move_type not in ['out_invoice', 'out_refund']"/>
</xpath>
<!-- Add ADP Portion and Client Portion columns after taxes - only for ADP invoices -->
<xpath expr="//field[@name='invoice_line_ids']//field[@name='tax_ids']" position="after">
<field name="x_fc_adp_portion" string="ADP" widget="monetary" optional="show"
column_invisible="parent.move_type not in ['out_invoice', 'out_refund'] or not parent.x_fc_is_adp_invoice"/>
<field name="x_fc_client_portion" string="Client" widget="monetary" optional="show"
column_invisible="parent.move_type not in ['out_invoice', 'out_refund'] or not parent.x_fc_is_adp_invoice"/>
</xpath>
</field>
</record>
<!-- ===================================================================== -->
<!-- INVOICE FORM: ADP Totals in Summary Footer -->
<!-- ===================================================================== -->
<record id="view_move_form_fusion_claims_totals" model="ir.ui.view">
<field name="name">account.move.form.fusion.central.totals</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="priority">70</field>
<field name="arch" type="xml">
<!-- Add ADP portion totals inside the subtotal footer group -->
<xpath expr="//group[hasclass('oe_subtotal_footer')]" position="inside">
<field name="x_fc_is_adp_invoice" invisible="1"/>
<field name="x_fc_adp_invoice_portion" invisible="1"/>
<!-- ADP Portion Breakdown - always show for ADP invoices -->
<div colspan="2" invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice">
<hr class="mt-2 mb-2"/>
</div>
<!-- Total ADP Portion (sum of line ADP portions) -->
<label for="x_fc_adp_portion_total" string="Total ADP Portion:"
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice"/>
<field name="x_fc_adp_portion_total" widget="monetary" nolabel="1"
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice"/>
<!-- Total Client Portion (sum of line client portions) -->
<label for="x_fc_client_portion_total" string="Total Client Portion:"
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice"/>
<field name="x_fc_client_portion_total" widget="monetary" nolabel="1"
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice"/>
<!-- Sibling Invoice Totals -->
<div colspan="2" invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice or x_fc_adp_invoice_portion == 'full'">
<hr class="mt-1 mb-1"/>
</div>
<!-- On Client invoice (25%), show the ADP invoice total -->
<label for="x_fc_sibling_adp_total" string="ADP Invoice Total:"
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice or x_fc_adp_invoice_portion != 'client'"/>
<field name="x_fc_sibling_adp_total" widget="monetary" nolabel="1"
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice or x_fc_adp_invoice_portion != 'client'"/>
<!-- On ADP invoice (75%), show the Client invoice total -->
<label for="x_fc_sibling_client_total" string="Client Invoice Total:"
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice or x_fc_adp_invoice_portion != 'adp'"/>
<field name="x_fc_sibling_client_total" widget="monetary" nolabel="1"
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice or x_fc_adp_invoice_portion != 'adp'"/>
</xpath>
</field>
</record>
<!-- ===================================================================== -->
<!-- INVOICE SEARCH: Filters -->
<!-- ===================================================================== -->
<record id="view_account_invoice_filter_fusion_claims" model="ir.ui.view">
<field name="name">account.move.search.fusion.central</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_account_invoice_filter"/>
<field name="arch" type="xml">
<xpath expr="//search" position="inside">
<separator/>
<filter string="ADP Invoices" name="adp_invoices"
domain="[('x_fc_invoice_type', 'in', ['adp', 'adp_odsp'])]"/>
<filter string="ADP Exported" name="adp_exported"
domain="[('adp_exported', '=', True)]"/>
<filter string="Not ADP Exported" name="not_adp_exported"
domain="[('adp_exported', '=', False), ('x_fc_invoice_type', 'in', ['adp', 'adp_odsp']), ('move_type', 'in', ['out_invoice', 'out_refund'])]"/>
<separator/>
<filter string="REG Clients" name="reg_clients"
domain="[('x_fc_client_type', '=', 'REG')]"/>
<filter string="ODS/OWP/ACS" name="full_funding"
domain="[('x_fc_client_type', 'in', ['ODS', 'OWP', 'ACS'])]"/>
<separator/>
<filter string="Client Invoices (25%)" name="client_invoices"
domain="[('x_fc_adp_invoice_portion', '=', 'client')]"/>
<filter string="ADP Invoices (75%)" name="adp_portion_invoices"
domain="[('x_fc_adp_invoice_portion', '=', 'adp')]"/>
<separator/>
<filter string="Billing: Waiting" name="billing_waiting"
domain="[('x_fc_adp_billing_status', '=', 'waiting')]"/>
<filter string="Billing: Submitted" name="billing_submitted"
domain="[('x_fc_adp_billing_status', '=', 'submitted')]"/>
<filter string="Billing: Need Correction" name="billing_need_correction"
domain="[('x_fc_adp_billing_status', '=', 'need_correction')]"/>
<filter string="Billing: Payment Issued" name="billing_payment_issued"
domain="[('x_fc_adp_billing_status', '=', 'payment_issued')]"/>
</xpath>
</field>
</record>
<!-- ===================================================================== -->
<!-- SERVER ACTION: Bulk Export -->
<!-- ===================================================================== -->
<record id="action_adp_export_wizard" model="ir.actions.act_window">
<field name="name">Export ADP Claims</field>
<field name="res_model">fusion_claims.export.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="binding_model_id" ref="account.model_account_move"/>
<field name="binding_view_types">list</field>
</record>
</odoo>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- ================================================================= -->
<!-- CLIENT CHAT SESSION VIEWS -->
<!-- ================================================================= -->
<!-- Chat Session Form View (conversation UI) -->
<record id="view_fusion_client_chat_session_form" model="ir.ui.view">
<field name="name">fusion.client.chat.session.form</field>
<field name="model">fusion.client.chat.session</field>
<field name="arch" type="xml">
<form string="Client Intelligence Chat">
<sheet>
<group>
<group>
<field name="name"/>
<field name="profile_id"/>
</group>
<group>
<field name="user_id" readonly="1"/>
<field name="state"/>
</group>
</group>
<!-- Conversation History -->
<separator string="Conversation"/>
<field name="message_ids" nolabel="1" readonly="1">
<list decoration-info="role == 'user'" decoration-success="role == 'assistant'"
create="0" delete="0" edit="0">
<field name="timestamp" width="160px"/>
<field name="role" width="80px"/>
<field name="content"/>
</list>
</field>
<!-- Input Area -->
<separator string="Ask a Question"/>
<group>
<field name="user_input" nolabel="1"
placeholder="Type your question here... e.g., 'How many clients are from Brampton?' or 'What devices has this client received?'"
widget="text"/>
</group>
</sheet>
<footer>
<button name="action_send_message" type="object"
string="Send" class="btn-primary" icon="fa-paper-plane"/>
<button string="Close" class="btn-secondary" special="cancel"/>
</footer>
</form>
</field>
</record>
<!-- Chat Session List View -->
<record id="view_fusion_client_chat_session_list" model="ir.ui.view">
<field name="name">fusion.client.chat.session.list</field>
<field name="model">fusion.client.chat.session</field>
<field name="arch" type="xml">
<list string="Chat Sessions">
<field name="name"/>
<field name="profile_id"/>
<field name="user_id"/>
<field name="create_date"/>
<field name="state"/>
</list>
</field>
</record>
<!-- ================================================================= -->
<!-- ACTIONS -->
<!-- ================================================================= -->
<!-- Global Chat Action (create new session) -->
<record id="action_fc_client_chat_new" model="ir.actions.act_window">
<field name="name">Client Intelligence</field>
<field name="res_model">fusion.client.chat.session</field>
<field name="view_mode">form</field>
<field name="target">current</field>
<field name="context">{'default_name': 'New Chat'}</field>
</record>
<!-- Chat History Action -->
<record id="action_fc_client_chat_history" model="ir.actions.act_window">
<field name="name">Chat History</field>
<field name="res_model">fusion.client.chat.session</field>
<field name="view_mode">list,form</field>
</record>
</odoo>

View File

@@ -0,0 +1,723 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- ================================================================= -->
<!-- CLIENT PROFILE VIEWS -->
<!-- ================================================================= -->
<!-- Form View -->
<record id="view_fusion_client_profile_form" model="ir.ui.view">
<field name="name">fusion.client.profile.form</field>
<field name="model">fusion.client.profile</field>
<field name="arch" type="xml">
<form string="Client Profile">
<header>
<button name="action_open_ai_chat" type="object"
string="Ask AI" icon="fa-comments"
class="btn-primary"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_view_claims" type="object"
class="oe_stat_button" icon="fa-folder-open">
<field name="claim_count" widget="statinfo" string="Claims"/>
</button>
<button name="action_view_applications" type="object"
class="oe_stat_button" icon="fa-file-text">
<field name="application_count" widget="statinfo" string="Applications"/>
</button>
</div>
<div class="oe_title mb-3">
<label for="partner_id" string="Odoo Contact"/>
<h1>
<field name="partner_id" placeholder="Link to Contact..." style="font-size: 1.5rem;"/>
</h1>
</div>
<group>
<group string="Identification">
<field name="first_name"/>
<field name="middle_initial" invisible="not middle_initial"/>
<field name="last_name"/>
<field name="health_card_number"/>
<field name="health_card_version"/>
<field name="date_of_birth"/>
<field name="ltch_name"/>
</group>
<group string="Financials">
<field name="total_adp_funded" widget="monetary"/>
<field name="total_client_portion" widget="monetary"/>
<field name="total_amount" widget="monetary"/>
<field name="currency_id" invisible="1"/>
<field name="last_assessment_date"/>
</group>
</group>
<notebook>
<page string="Address &amp; Contact" name="address">
<group>
<group string="Address">
<field name="unit_number"/>
<field name="street_number"/>
<field name="street_name"/>
<field name="rural_route"/>
<field name="city"/>
<field name="province"/>
<field name="postal_code"/>
</group>
<group string="Contact">
<field name="home_phone" widget="phone"/>
<field name="business_phone" widget="phone"/>
<field name="phone_extension"/>
</group>
</group>
</page>
<page string="Medical &amp; Benefits" name="medical">
<group>
<group string="Benefits Eligibility">
<field name="receives_social_assistance"/>
<field name="benefit_type"
invisible="not receives_social_assistance"/>
<field name="wsib_eligible"/>
<field name="vac_eligible"/>
</group>
</group>
<separator string="Current Medical Condition / Diagnosis"/>
<field name="medical_condition" nolabel="1"
placeholder="Medical condition/diagnosis from latest application..."/>
<separator string="Functional Mobility Status"/>
<field name="mobility_status" nolabel="1"
placeholder="Functional mobility status from latest application..."/>
</page>
<page string="Application History" name="applications">
<field name="application_data_ids" nolabel="1">
<list>
<field name="application_date"/>
<field name="device_category"/>
<field name="base_device"/>
<field name="reason_for_application"/>
<field name="authorizer_first_name"/>
<field name="authorizer_last_name"/>
<field name="sections_submitted"/>
<field name="sale_order_id"/>
</list>
</field>
</page>
<page string="AI Analysis" name="ai">
<group string="Summary">
<field name="ai_summary" nolabel="1" readonly="1" widget="text"/>
</group>
<group string="Risk Flags">
<field name="ai_risk_flags" nolabel="1" readonly="1" widget="text"/>
</group>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<!-- List View -->
<record id="view_fusion_client_profile_list" model="ir.ui.view">
<field name="name">fusion.client.profile.list</field>
<field name="model">fusion.client.profile</field>
<field name="arch" type="xml">
<list string="Client Profiles">
<field name="last_name"/>
<field name="first_name"/>
<field name="health_card_number"/>
<field name="date_of_birth"/>
<field name="city"/>
<field name="claim_count"/>
<field name="total_adp_funded" widget="monetary" sum="Total ADP"/>
<field name="total_client_portion" widget="monetary" sum="Total Client"/>
<field name="last_assessment_date"/>
<field name="currency_id" column_invisible="1"/>
</list>
</field>
</record>
<!-- Search View -->
<record id="view_fusion_client_profile_search" model="ir.ui.view">
<field name="name">fusion.client.profile.search</field>
<field name="model">fusion.client.profile</field>
<field name="arch" type="xml">
<search string="Search Client Profiles">
<field name="first_name"/>
<field name="last_name"/>
<field name="health_card_number"/>
<field name="city"/>
<field name="postal_code"/>
<field name="medical_condition"/>
<separator/>
<filter string="Has Active Claims" name="has_claims"
domain="[('claim_count', '>', 0)]"/>
<filter string="Receives Social Assistance" name="social_assistance"
domain="[('receives_social_assistance', '=', True)]"/>
<filter string="WSIB Eligible" name="wsib"
domain="[('wsib_eligible', '=', True)]"/>
<separator/>
<filter string="City" name="group_city" context="{'group_by': 'city'}"/>
<filter string="Province" name="group_province" context="{'group_by': 'province'}"/>
<filter string="Benefit Type" name="group_benefit" context="{'group_by': 'benefit_type'}"/>
</search>
</field>
</record>
<!-- Action -->
<record id="action_fusion_client_profiles" model="ir.actions.act_window">
<field name="name">Client Profiles</field>
<field name="res_model">fusion.client.profile</field>
<field name="view_mode">list,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No client profiles yet
</p>
<p>
Client profiles are automatically created when ADP XML files are
uploaded to sale orders or imported via Configuration > Import XML Files.
</p>
</field>
</record>
<!-- ================================================================= -->
<!-- ADP APPLICATION DATA VIEWS -->
<!-- ================================================================= -->
<!-- Application Data Form View -->
<record id="view_fusion_adp_application_data_form" model="ir.ui.view">
<field name="name">fusion.adp.application.data.form</field>
<field name="model">fusion.adp.application.data</field>
<field name="arch" type="xml">
<form string="ADP Application Data">
<header>
<button name="action_export_xml" type="object"
string="Export XML" icon="fa-download"
class="btn-secondary"/>
</header>
<sheet>
<!-- Top summary -->
<group>
<group string="Application Info">
<field name="profile_id"/>
<field name="sale_order_id"/>
<field name="device_category"/>
<field name="version_number"/>
<field name="application_date"/>
<field name="sections_submitted"/>
</group>
<group string="Applicant">
<field name="applicant_first_name"/>
<field name="applicant_last_name"/>
<field name="applicant_middle_initial"/>
<field name="health_card_number"/>
<field name="health_card_version"/>
<field name="date_of_birth"/>
</group>
</group>
<notebook>
<!-- ========== SECTION 1 ========== -->
<page string="Section 1 - Applicant" name="section1">
<group>
<group string="Address">
<field name="unit_number"/>
<field name="street_number"/>
<field name="street_name"/>
<field name="rural_route"/>
<field name="city"/>
<field name="province"/>
<field name="postal_code"/>
</group>
<group string="Contact">
<field name="home_phone" widget="phone"/>
<field name="business_phone" widget="phone"/>
<field name="phone_extension"/>
<field name="ltch_name"/>
</group>
</group>
<group string="Confirmation of Benefits">
<group>
<field name="receives_social_assistance"/>
<field name="benefit_owp"/>
<field name="benefit_odsp"/>
<field name="benefit_acsd"/>
</group>
<group>
<field name="wsib_eligible"/>
<field name="vac_eligible"/>
</group>
</group>
</page>
<!-- ========== SECTION 2 - DEVICES ========== -->
<page string="Section 2 - Devices" name="section2">
<group string="Medical Condition and Mobility Status">
<field name="medical_condition" nolabel="1" placeholder="Presenting medical condition..."/>
</group>
<group>
<field name="mobility_status" nolabel="1" placeholder="Functional mobility status..."/>
</group>
<separator string="Mobility Equipment Previously Funded by ADP"/>
<group>
<group>
<field name="prev_funded_none"/>
<field name="prev_funded_forearm"/>
<field name="prev_funded_wheeled"/>
<field name="prev_funded_manual"/>
<field name="prev_funded_power"/>
</group>
<group>
<field name="prev_funded_addon"/>
<field name="prev_funded_scooter"/>
<field name="prev_funded_seating"/>
<field name="prev_funded_tilt"/>
<field name="prev_funded_recline"/>
<field name="prev_funded_legrests"/>
<field name="prev_funded_frame"/>
<field name="prev_funded_stroller"/>
</group>
</group>
<separator string="Devices Currently Required"/>
<group>
<group>
<field name="device_forearm_crutches"/>
<field name="device_wheeled_walker"/>
<field name="device_manual_wheelchair"/>
<field name="device_ambulation_manual"/>
<field name="device_dependent_wheelchair"/>
<field name="device_dynamic_tilt"/>
<field name="device_manual_dynamic"/>
<field name="device_manual_power_addon"/>
</group>
<group>
<field name="device_power_base"/>
<field name="device_power_scooter"/>
<field name="device_ambulation_power"/>
<field name="device_positioning"/>
<field name="device_high_tech"/>
<field name="device_standing_frame"/>
<field name="device_adp_funded_mods"/>
<field name="device_non_adp_funded_mods"/>
</group>
</group>
</page>
<!-- ========== SECTION 2A - WALKERS ========== -->
<page string="Section 2a - Walkers" name="section2a">
<group>
<group string="Base Device">
<field name="s2a_base_device"/>
<field name="s2a_paediatric_frame"/>
<field name="s2a_forearm_crutches"/>
</group>
<group string="Reason for Application">
<field name="s2a_reason"/>
<field name="s2a_replacement_status"/>
<field name="s2a_replacement_size"/>
<field name="s2a_replacement_adp"/>
<field name="s2a_replacement_special"/>
</group>
</group>
<group string="Prescription Details">
<group>
<field name="s2a_seat_height"/>
<field name="s2a_seat_height_unit"/>
<field name="s2a_handle_height"/>
<field name="s2a_handle_height_unit"/>
<field name="s2a_hand_grips"/>
<field name="s2a_forearm_attachments"/>
</group>
<group>
<field name="s2a_width_handles"/>
<field name="s2a_width_handles_unit"/>
<field name="s2a_client_weight"/>
<field name="s2a_client_weight_unit"/>
<field name="s2a_brakes"/>
<field name="s2a_brake_type"/>
<field name="s2a_num_wheels"/>
<field name="s2a_wheel_size"/>
<field name="s2a_back_support"/>
</group>
</group>
<group string="Eligibility Confirmations">
<group>
<field name="s2a_confirm1"/>
<field name="s2a_confirm2"/>
<field name="s2a_confirm3"/>
</group>
<group>
<field name="s2a_confirm4"/>
<field name="s2a_confirm5"/>
<field name="s2a_confirm6"/>
</group>
</group>
<group>
<group>
<field name="s2a_custom"/>
<field name="s2a_cost_labour"/>
</group>
</group>
</page>
<!-- ========== SECTION 2B - MANUAL WHEELCHAIRS ========== -->
<page string="Section 2b - Manual Chairs" name="section2b">
<group>
<group string="Base Device">
<field name="s2b_base_device"/>
<field name="s2b_power_addon"/>
</group>
<group string="Reason for Application">
<field name="s2b_reason"/>
<field name="s2b_replacement_status"/>
<field name="s2b_replacement_size"/>
<field name="s2b_replacement_adp"/>
<field name="s2b_replacement_special"/>
</group>
</group>
<group string="Prescription Details">
<group>
<field name="s2b_seat_width"/>
<field name="s2b_seat_width_unit"/>
<field name="s2b_seat_depth"/>
<field name="s2b_seat_depth_unit"/>
<field name="s2b_floor_height"/>
<field name="s2b_floor_height_unit"/>
<field name="s2b_cane_height"/>
<field name="s2b_cane_height_unit"/>
</group>
<group>
<field name="s2b_back_height"/>
<field name="s2b_back_height_unit"/>
<field name="s2b_rest_length"/>
<field name="s2b_rest_length_unit"/>
<field name="s2b_client_weight"/>
<field name="s2b_client_weight_unit"/>
</group>
</group>
<separator string="Additional ADP Funded Options"/>
<group>
<group>
<field name="s2b_adjustable_tension"/>
<field name="s2b_heavy_duty"/>
<field name="s2b_recliner"/>
<field name="s2b_footplates"/>
<field name="s2b_legrests"/>
<field name="s2b_spoke"/>
<field name="s2b_projected"/>
<field name="s2b_standard_manual"/>
<field name="s2b_grade_aids"/>
<field name="s2b_caster_pin"/>
</group>
<group>
<field name="s2b_amputee_axle"/>
<field name="s2b_quick_release"/>
<field name="s2b_stroller"/>
<field name="s2b_oxygen"/>
<field name="s2b_ventilator"/>
<field name="s2b_titanium"/>
<field name="s2b_clothing_guards"/>
<field name="s2b_one_arm"/>
<field name="s2b_uni_lateral"/>
<field name="s2b_plastic"/>
</group>
</group>
<group>
<field name="s2b_rationale" nolabel="1" placeholder="Clinical rationale..."/>
<field name="s2b_custom"/>
<field name="s2b_cost_labour"/>
</group>
</page>
<!-- ========== SECTION 2C - POWER BASES / SCOOTERS ========== -->
<page string="Section 2c - Power/Scooter" name="section2c">
<group>
<group string="Base Device">
<field name="s2c_base_device"/>
</group>
<group string="Reason for Application">
<field name="s2c_reason"/>
<field name="s2c_replacement_status"/>
<field name="s2c_replacement_size"/>
<field name="s2c_replacement_adp"/>
<field name="s2c_replacement_special"/>
</group>
</group>
<group string="Prescription Details">
<group>
<field name="s2c_seat_width"/>
<field name="s2c_seat_width_unit"/>
<field name="s2c_back_height"/>
<field name="s2c_back_height_unit"/>
<field name="s2c_floor_height"/>
<field name="s2c_floor_height_unit"/>
</group>
<group>
<field name="s2c_rest_length"/>
<field name="s2c_rest_length_unit"/>
<field name="s2c_seat_depth"/>
<field name="s2c_seat_depth_unit"/>
<field name="s2c_client_weight"/>
<field name="s2c_client_weight_unit"/>
</group>
</group>
<separator string="Additional ADP Funded Options"/>
<group>
<group>
<field name="s2c_adjustable_tension"/>
<field name="s2c_midline"/>
<field name="s2c_manual_recline"/>
<field name="s2c_footplates"/>
<field name="s2c_legrests"/>
<field name="s2c_swingaway"/>
</group>
<group>
<field name="s2c_one_piece"/>
<field name="s2c_seat_package_1"/>
<field name="s2c_seat_package_2"/>
<field name="s2c_oxygen"/>
<field name="s2c_ventilator"/>
</group>
</group>
<separator string="Specialty Controls"/>
<group>
<group>
<field name="s2c_sp_controls_1"/>
<field name="s2c_sp_controls_2"/>
<field name="s2c_sp_controls_3"/>
<field name="s2c_sp_controls_4"/>
</group>
<group>
<field name="s2c_sp_controls_5"/>
<field name="s2c_sp_controls_6"/>
<field name="s2c_auto_correction"/>
</group>
</group>
<separator string="Power Positioning Devices"/>
<group>
<group>
<field name="s2c_power_tilt"/>
<field name="s2c_power_recline"/>
<field name="s2c_tilt_and_recline"/>
</group>
<group>
<field name="s2c_power_elevating"/>
<field name="s2c_control_box"/>
</group>
</group>
<group>
<field name="s2c_rationale" nolabel="1" placeholder="Clinical rationale..."/>
<field name="s2c_custom"/>
<field name="s2c_cost_labour"/>
</group>
<group string="Eligibility Confirmations">
<group>
<field name="s2c_confirm1"/>
<field name="s2c_confirm2"/>
<field name="s2c_confirm3"/>
</group>
<group>
<field name="s2c_confirm4"/>
<field name="s2c_confirm5"/>
</group>
</group>
</page>
<!-- ========== SECTION 2D - POSITIONING/SEATING ========== -->
<page string="Section 2d - Seating" name="section2d">
<group string="Seat Cushion">
<group>
<field name="s2d_seat_modular"/>
<field name="s2d_seat_custom"/>
<field name="s2d_seat_cover_modular"/>
<field name="s2d_seat_cover_custom"/>
<field name="s2d_seat_option_modular"/>
<field name="s2d_seat_option_custom"/>
</group>
<group>
<field name="s2d_seat_hardware_modular"/>
<field name="s2d_seat_hardware_custom"/>
<field name="s2d_adductor_modular"/>
<field name="s2d_adductor_custom"/>
<field name="s2d_pommel_custom"/>
</group>
</group>
<group string="Back Support">
<group>
<field name="s2d_back_modular"/>
<field name="s2d_back_custom"/>
<field name="s2d_back_option_modular"/>
<field name="s2d_back_option_custom"/>
</group>
<group>
<field name="s2d_back_cover_custom"/>
<field name="s2d_back_hardware_modular"/>
<field name="s2d_back_hardware_custom"/>
</group>
</group>
<group string="Headrest, Belt, Arm, Tray, Lateral, Foot Supports">
<group>
<field name="s2d_complete_modular"/>
<field name="s2d_complete_custom"/>
<field name="s2d_headrest_modular"/>
<field name="s2d_headrest_custom"/>
<field name="s2d_head_option_custom"/>
<field name="s2d_head_hardware_modular"/>
<field name="s2d_head_hardware_custom"/>
<field name="s2d_belt_modular"/>
<field name="s2d_belt_custom"/>
<field name="s2d_belt_option_custom"/>
<field name="s2d_arm_modular"/>
<field name="s2d_arm_custom"/>
<field name="s2d_arm_option_modular"/>
<field name="s2d_arm_option_custom"/>
</group>
<group>
<field name="s2d_arm_hardware_modular"/>
<field name="s2d_arm_hardware_custom"/>
<field name="s2d_tray_modular"/>
<field name="s2d_tray_custom"/>
<field name="s2d_tray_option_modular"/>
<field name="s2d_tray_option_custom"/>
<field name="s2d_lateral_modular"/>
<field name="s2d_lateral_custom"/>
<field name="s2d_lateral_option_custom"/>
<field name="s2d_lateral_hardware_custom"/>
<field name="s2d_foot_modular"/>
<field name="s2d_foot_custom"/>
<field name="s2d_foot_option_modular"/>
<field name="s2d_foot_option_custom"/>
<field name="s2d_foot_hardware_modular"/>
<field name="s2d_foot_hardware_custom"/>
</group>
</group>
<group string="Application Details">
<group>
<field name="s2d_reason"/>
<field name="s2d_replacement_status"/>
<field name="s2d_replacement_size"/>
<field name="s2d_replacement_adp"/>
<field name="s2d_replacement_special"/>
</group>
<group>
<field name="s2d_confirm1"/>
<field name="s2d_confirm2"/>
<field name="s2d_custom"/>
<field name="s2d_cost_labour"/>
</group>
</group>
</page>
<!-- ========== SECTION 3 - CONSENT ========== -->
<page string="Section 3 - Consent" name="section3">
<group>
<group string="Applicant Signature">
<field name="consent_date"/>
<field name="consent_signed_by"/>
</group>
<group string="Agent/Contact (if applicable)">
<field name="agent_relationship"/>
<field name="agent_first_name"/>
<field name="agent_last_name"/>
<field name="agent_city"/>
<field name="agent_province"/>
<field name="agent_postal_code"/>
<field name="agent_home_phone" widget="phone"/>
<field name="agent_bus_phone" widget="phone"/>
</group>
</group>
</page>
<!-- ========== SECTION 4 - AUTHORIZER & VENDOR ========== -->
<page string="Section 4 - Signatures" name="section4">
<group>
<group string="Authorizer">
<field name="authorizer_first_name"/>
<field name="authorizer_last_name"/>
<field name="authorizer_phone" widget="phone"/>
<field name="authorizer_phone_ext"/>
<field name="authorizer_adp_number"/>
<field name="assessment_date"/>
</group>
<group string="Vendor 1">
<field name="vendor_business_name"/>
<field name="vendor_adp_number"/>
<field name="vendor_representative"/>
<field name="vendor_position"/>
<field name="vendor_location"/>
<field name="vendor_phone" widget="phone"/>
<field name="vendor_phone_ext"/>
<field name="vendor_sign_date"/>
</group>
</group>
<group>
<group string="Vendor 2">
<field name="vendor2_business_name"/>
<field name="vendor2_adp_number"/>
<field name="vendor2_representative"/>
<field name="vendor2_position"/>
<field name="vendor2_location"/>
<field name="vendor2_phone" widget="phone"/>
<field name="vendor2_sign_date"/>
</group>
<group string="Equipment Specification (Page 12)">
<field name="equip_vendor_invoice_no"/>
<field name="equip_vendor_adp_reg"/>
<field name="equip_cell1"/>
<field name="equip_cell2"/>
<field name="equip_cell3"/>
<field name="equip_cell4"/>
<field name="equip_cell5"/>
</group>
</group>
<group>
<group string="Proof of Delivery">
<field name="pod_received_by"/>
<field name="pod_date"/>
</group>
<group string="Sections Submitted to ADP">
<field name="note_section1"/>
<field name="note_section2a"/>
<field name="note_section2b"/>
<field name="note_section2c"/>
<field name="note_section2d"/>
<field name="note_section3and4"/>
<field name="note_vendor_replacement"/>
<field name="note_vendor_custom"/>
<field name="note_funding_chart"/>
<field name="note_letter"/>
</group>
</group>
</page>
<!-- ========== RAW XML ========== -->
<page string="Raw XML" name="raw">
<field name="raw_xml" widget="text" readonly="1"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- Application Data List View -->
<record id="view_fusion_adp_application_data_list" model="ir.ui.view">
<field name="name">fusion.adp.application.data.list</field>
<field name="model">fusion.adp.application.data</field>
<field name="arch" type="xml">
<list string="ADP Application Data">
<field name="applicant_last_name"/>
<field name="applicant_first_name"/>
<field name="health_card_number"/>
<field name="application_date"/>
<field name="device_category"/>
<field name="base_device"/>
<field name="reason_for_application"/>
<field name="city"/>
<field name="sections_submitted"/>
<field name="sale_order_id"/>
<field name="profile_id"/>
</list>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,165 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="view_fusion_claims_dashboard_form" model="ir.ui.view">
<field name="name">fusion.claims.dashboard.form</field>
<field name="model">fusion.claims.dashboard</field>
<field name="arch" type="xml">
<form string="Dashboard" create="0" delete="0">
<sheet>
<!-- ===== FUNDING CARDS (one line, bigger) ===== -->
<div class="d-flex flex-nowrap gap-2 mb-4 overflow-auto">
<div invisible="adp_count == 0" style="flex: 1 1 0; min-width: 120px;">
<button name="action_open_adp" type="object" class="btn p-0 w-100 border-0">
<div class="text-white text-center py-3 px-2" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 14px;">
<div class="fw-bold" style="font-size: 1.8rem;"><field name="adp_count"/></div>
<div style="font-size: 0.85rem;">ADP</div>
</div>
</button>
</div>
<div invisible="odsp_count == 0" style="flex: 1 1 0; min-width: 120px;">
<button name="action_open_odsp" type="object" class="btn p-0 w-100 border-0">
<div class="text-white text-center py-3 px-2" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); border-radius: 14px;">
<div class="fw-bold" style="font-size: 1.8rem;"><field name="odsp_count"/></div>
<div style="font-size: 0.85rem;">ODSP</div>
</div>
</button>
</div>
<div invisible="march_of_dimes_count == 0" style="flex: 1 1 0; min-width: 120px;">
<button name="action_open_march" type="object" class="btn p-0 w-100 border-0">
<div class="text-white text-center py-3 px-2" style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); border-radius: 14px;">
<div class="fw-bold" style="font-size: 1.8rem;"><field name="march_of_dimes_count"/></div>
<div style="font-size: 0.85rem;">March of Dimes</div>
</div>
</button>
</div>
<div invisible="hardship_count == 0" style="flex: 1 1 0; min-width: 120px;">
<button name="action_open_hardship" type="object" class="btn p-0 w-100 border-0">
<div class="text-white text-center py-3 px-2" style="background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); border-radius: 14px;">
<div class="fw-bold" style="font-size: 1.8rem;"><field name="hardship_count"/></div>
<div style="font-size: 0.85rem;">Hardship</div>
</div>
</button>
</div>
<div invisible="acsd_count == 0" style="flex: 1 1 0; min-width: 120px;">
<button name="action_open_acsd" type="object" class="btn p-0 w-100 border-0">
<div class="text-white text-center py-3 px-2" style="background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); border-radius: 14px;">
<div class="fw-bold" style="font-size: 1.8rem;"><field name="acsd_count"/></div>
<div style="font-size: 0.85rem;">ACSD</div>
</div>
</button>
</div>
<div invisible="muscular_dystrophy_count == 0" style="flex: 1 1 0; min-width: 120px;">
<button name="action_open_muscular" type="object" class="btn p-0 w-100 border-0">
<div class="text-white text-center py-3 px-2" style="background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); border-radius: 14px;">
<div class="fw-bold" style="font-size: 1.8rem;"><field name="muscular_dystrophy_count"/></div>
<div style="font-size: 0.85rem;">Muscular Dystrophy</div>
</div>
</button>
</div>
<div invisible="insurance_count == 0" style="flex: 1 1 0; min-width: 120px;">
<button name="action_open_insurance" type="object" class="btn p-0 w-100 border-0">
<div class="text-dark text-center py-3 px-2" style="background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); border-radius: 14px;">
<div class="fw-bold" style="font-size: 1.8rem;"><field name="insurance_count"/></div>
<div style="font-size: 0.85rem;">Insurance</div>
</div>
</button>
</div>
<div invisible="wsib_count == 0" style="flex: 1 1 0; min-width: 120px;">
<button name="action_open_wsib" type="object" class="btn p-0 w-100 border-0">
<div class="text-dark text-center py-3 px-2" style="background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%); border-radius: 14px;">
<div class="fw-bold" style="font-size: 1.8rem;"><field name="wsib_count"/></div>
<div style="font-size: 0.85rem;">WSIB</div>
</div>
</button>
</div>
<div invisible="total_profiles == 0" style="flex: 1 1 0; min-width: 120px;">
<button name="action_open_profiles" type="object" class="btn p-0 w-100 border-0">
<div class="text-white text-center py-3 px-2" style="background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); border-radius: 14px;">
<div class="fw-bold" style="font-size: 1.8rem;"><field name="total_profiles"/></div>
<div style="font-size: 0.85rem;">Profiles</div>
</div>
</button>
</div>
</div>
<!-- ===== PANEL SELECTORS (4 dropdowns) ===== -->
<div class="row g-2 mb-3">
<div class="col-3">
<div class="fw-bold mb-1" style="font-size: 0.8rem;">Window 1</div>
<field name="panel1_type" nolabel="1"/>
</div>
<div class="col-3">
<div class="fw-bold mb-1" style="font-size: 0.8rem;">Window 2</div>
<field name="panel2_type" nolabel="1"/>
</div>
<div class="col-3">
<div class="fw-bold mb-1" style="font-size: 0.8rem;">Window 3</div>
<field name="panel3_type" nolabel="1"/>
</div>
<div class="col-3">
<div class="fw-bold mb-1" style="font-size: 0.8rem;">Window 4</div>
<field name="panel4_type" nolabel="1"/>
</div>
</div>
<!-- ===== TOP PANELS ROW 1 ===== -->
<div class="row g-3 mb-3">
<div class="col-12 col-lg-6">
<div class="card" style="border-radius: 14px; overflow: hidden;">
<div class="card-header fw-bold text-white py-2" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);">
<field name="panel1_title" nolabel="1"/>
</div>
<div class="card-body p-0" style="max-height: 400px; overflow-y: auto;">
<field name="panel1_html" class="w-100" nolabel="1"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6">
<div class="card" style="border-radius: 14px; overflow: hidden;">
<div class="card-header fw-bold text-white py-2" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);">
<field name="panel2_title" nolabel="1"/>
</div>
<div class="card-body p-0" style="max-height: 400px; overflow-y: auto;">
<field name="panel2_html" class="w-100" nolabel="1"/>
</div>
</div>
</div>
</div>
<!-- ===== TOP PANELS ROW 2 ===== -->
<div class="row g-3">
<div class="col-12 col-lg-6">
<div class="card" style="border-radius: 14px; overflow: hidden;">
<div class="card-header fw-bold text-white py-2" style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);">
<field name="panel3_title" nolabel="1"/>
</div>
<div class="card-body p-0" style="max-height: 400px; overflow-y: auto;">
<field name="panel3_html" class="w-100" nolabel="1"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6">
<div class="card" style="border-radius: 14px; overflow: hidden;">
<div class="card-header fw-bold text-white py-2" style="background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);">
<field name="panel4_title" nolabel="1"/>
</div>
<div class="card-body p-0" style="max-height: 400px; overflow-y: auto;">
<field name="panel4_html" class="w-100" nolabel="1"/>
</div>
</div>
</div>
</div>
</sheet>
</form>
</field>
</record>
<!-- Dashboard Action -->
<record id="action_fusion_claims_dashboard" model="ir.actions.act_window">
<field name="name">Dashboard</field>
<field name="res_model">fusion.claims.dashboard</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_fusion_claims_dashboard_form"/>
<field name="target">current</field>
</record>
</odoo>

View File

@@ -0,0 +1,261 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2024-2026 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
-->
<odoo>
<!-- ===================================================================== -->
<!-- LOANER CHECKOUT VIEWS -->
<!-- ===================================================================== -->
<!-- List View -->
<record id="view_fusion_loaner_checkout_list" model="ir.ui.view">
<field name="name">fusion.loaner.checkout.list</field>
<field name="model">fusion.loaner.checkout</field>
<field name="arch" type="xml">
<list decoration-danger="state == 'overdue'"
decoration-warning="state == 'rental_pending'"
decoration-muted="state in ('returned', 'lost')">
<field name="name"/>
<field name="partner_id"/>
<field name="product_id"/>
<field name="lot_id" optional="show"/>
<field name="checkout_date"/>
<field name="expected_return_date"/>
<field name="days_out"/>
<field name="state" widget="badge"/>
</list>
</field>
</record>
<!-- Form View -->
<record id="view_fusion_loaner_checkout_form" model="ir.ui.view">
<field name="name">fusion.loaner.checkout.form</field>
<field name="model">fusion.loaner.checkout</field>
<field name="arch" type="xml">
<form>
<header>
<button name="action_checkout" type="object" string="Confirm Checkout"
class="btn-primary" invisible="state != 'draft'"/>
<button name="action_return" type="object" string="Return Loaner"
class="btn-success" invisible="state not in ('checked_out', 'overdue', 'rental_pending')"/>
<field name="state" widget="statusbar"
statusbar_visible="draft,checked_out,returned"/>
</header>
<sheet>
<div class="oe_title">
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<group>
<group string="Client Information">
<field name="partner_id"/>
<field name="sales_rep_id"/>
<field name="sale_order_id"/>
</group>
<group string="Product">
<field name="product_id"/>
<field name="lot_id"/>
<field name="loaner_period_days"/>
</group>
</group>
<group>
<group string="Dates">
<field name="checkout_date"/>
<field name="expected_return_date"/>
<field name="actual_return_date"/>
<field name="days_out"/>
</group>
<group string="Condition">
<field name="checkout_condition"/>
<field name="checkout_notes"/>
</group>
</group>
</sheet>
<chatter/>
</form>
</field>
</record>
<!-- Search View -->
<record id="view_fusion_loaner_checkout_search" model="ir.ui.view">
<field name="name">fusion.loaner.checkout.search</field>
<field name="model">fusion.loaner.checkout</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="partner_id"/>
<field name="product_id"/>
</search>
</field>
</record>
<!-- ===================================================================== -->
<!-- LOANER HISTORY VIEWS -->
<!-- ===================================================================== -->
<record id="view_fusion_loaner_history_list" model="ir.ui.view">
<field name="name">fusion.loaner.history.list</field>
<field name="model">fusion.loaner.history</field>
<field name="arch" type="xml">
<list>
<field name="action_date"/>
<field name="checkout_id"/>
<field name="action" widget="badge"/>
<field name="user_id"/>
<field name="notes"/>
</list>
</field>
</record>
<!-- ===================================================================== -->
<!-- WIZARD VIEWS -->
<!-- ===================================================================== -->
<!-- Checkout Wizard -->
<record id="view_loaner_checkout_wizard_form" model="ir.ui.view">
<field name="name">fusion.loaner.checkout.wizard.form</field>
<field name="model">fusion.loaner.checkout.wizard</field>
<field name="arch" type="xml">
<form>
<group>
<field name="partner_id"/>
<field name="product_id"/>
<field name="lot_id"/>
<field name="checkout_date"/>
<field name="loaner_period_days"/>
<field name="checkout_condition" widget="radio"/>
<field name="checkout_notes"/>
</group>
<footer>
<button name="action_checkout" type="object" string="Checkout Loaner" class="btn-primary"/>
<button string="Cancel" class="btn-secondary" special="cancel"/>
</footer>
</form>
</field>
</record>
<!-- Return Wizard -->
<record id="view_loaner_return_wizard_form" model="ir.ui.view">
<field name="name">fusion.loaner.return.wizard.form</field>
<field name="model">fusion.loaner.return.wizard</field>
<field name="arch" type="xml">
<form>
<group>
<field name="checkout_id" readonly="1"/>
<field name="return_date"/>
<field name="return_condition" widget="radio"/>
<field name="return_notes"/>
</group>
<footer>
<button name="action_return" type="object" string="Confirm Return" class="btn-primary"/>
<button string="Cancel" class="btn-secondary" special="cancel"/>
</footer>
</form>
</field>
</record>
<!-- ===================================================================== -->
<!-- ACTIONS -->
<!-- ===================================================================== -->
<record id="action_fusion_loaner_checkout" model="ir.actions.act_window">
<field name="name">Loaner Equipment</field>
<field name="res_model">fusion.loaner.checkout</field>
<field name="view_mode">list,form</field>
</record>
<record id="action_fusion_loaner_history" model="ir.actions.act_window">
<field name="name">Loaner History</field>
<field name="res_model">fusion.loaner.history</field>
<field name="view_mode">list</field>
</record>
<!-- Action: Loaner Products (products that can be loaned) -->
<record id="action_fusion_loaner_products" model="ir.actions.act_window">
<field name="name">Loaner Products</field>
<field name="res_model">product.template</field>
<field name="view_mode">list,form</field>
<field name="domain">[('x_fc_can_be_loaned', '=', True)]</field>
<field name="context">{'default_x_fc_can_be_loaned': True, 'default_sale_ok': False, 'default_purchase_ok': False, 'default_rent_ok': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No loaner products configured yet
</p>
<p>
Mark products as "Loaner" in the product form to add them here.
</p>
</field>
</record>
<!-- ===================================================================== -->
<!-- MENUS -->
<!-- ===================================================================== -->
<menuitem id="menu_loaner_root"
name="Loaner Management"
parent="menu_adp_claims_root"
sequence="58"/>
<menuitem id="menu_loaner_active"
name="Active Loaners"
parent="menu_loaner_root"
action="action_fusion_loaner_checkout"
sequence="10"/>
<menuitem id="menu_loaner_history"
name="Loaner History"
parent="menu_loaner_root"
action="action_fusion_loaner_history"
sequence="20"/>
<menuitem id="menu_loaner_products"
name="Loaner Products"
parent="menu_loaner_root"
action="action_fusion_loaner_products"
sequence="30"/>
<!-- ===================================================================== -->
<!-- PRODUCT TEMPLATE LOANER FIELDS -->
<!-- ===================================================================== -->
<!-- Add "Can be Loaned" checkbox next to other product type checkboxes -->
<record id="view_product_template_loaner_checkbox" model="ir.ui.view">
<field name="name">product.template.loaner.checkbox</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="priority">50</field>
<field name="arch" type="xml">
<xpath expr="//div[@name='options']" position="inside">
<span class="d-inline-flex">
<field name="x_fc_can_be_loaned"/>
<label for="x_fc_can_be_loaned" string="Loaner"/>
</span>
</xpath>
</field>
</record>
<!-- Loaner Settings tab (only visible when Can be Loaned is checked) -->
<record id="view_product_template_loaner_form" model="ir.ui.view">
<field name="name">product.template.loaner.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='sales']" position="after">
<page string="Loaner Settings" name="loaner_settings" invisible="not x_fc_can_be_loaned">
<group>
<group string="Loaner Period">
<field name="x_fc_loaner_period_days"/>
</group>
<group string="Rental Pricing (if not returned)">
<field name="x_fc_rental_price_weekly"/>
<field name="x_fc_rental_price_monthly"/>
</group>
</group>
</page>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- SA Signature Template - Form View -->
<record id="view_fusion_sa_signature_template_form" model="ir.ui.view">
<field name="name">fusion.sa.signature.template.form</field>
<field name="model">fusion.sa.signature.template</field>
<field name="arch" type="xml">
<form string="SA Signature Template">
<sheet>
<div class="oe_title">
<h1><field name="name" placeholder="e.g. SA Mobility Standard"/></h1>
</div>
<group>
<group>
<field name="sa_default_sig_page" string="Default Signature Page"/>
<field name="active"/>
</group>
<group>
<field name="notes" placeholder="Usage notes"/>
</group>
</group>
<div class="row mt-3">
<div class="col-5">
<h4>Signature Coordinates</h4>
<div class="text-muted mb-2" style="font-size: 0.85em;">
PDF points (72 pts = 1 inch). Y = from top.
</div>
<group string="Name">
<field name="sa_sig_name_x" string="X"/>
<field name="sa_sig_name_y" string="Y from top"/>
</group>
<group string="Date">
<field name="sa_sig_date_x" string="X"/>
<field name="sa_sig_date_y" string="Y from top"/>
</group>
<group string="Signature">
<field name="sa_sig_x" string="X"/>
<field name="sa_sig_y" string="Y from top"/>
<field name="sa_sig_w" string="Width"/>
<field name="sa_sig_h" string="Height"/>
</group>
<separator/>
<group>
<field name="preview_pdf" filename="preview_pdf_filename"
string="Sample PDF"/>
<field name="preview_pdf_filename" invisible="1"/>
<field name="preview_pdf_page" string="Preview Page"
help="0 = use Default Signature Page above"/>
</group>
</div>
<div class="col-7">
<h4>Preview</h4>
<div class="text-muted mb-2" style="font-size: 0.85em;">
Upload a sample PDF on the left to see where signatures land.
</div>
<field name="preview_image" widget="image" invisible="not preview_image"
options="{'size': [700, 0]}" class="w-100"/>
<div invisible="preview_image" class="text-muted text-center p-5"
style="border: 1px dashed #666; border-radius: 8px;">
<p>No preview available.</p>
<p>Upload a sample SA Mobility approval PDF to see signature placement.</p>
</div>
</div>
</div>
</sheet>
</form>
</field>
</record>
<!-- SA Signature Template - List View -->
<record id="view_fusion_sa_signature_template_list" model="ir.ui.view">
<field name="name">fusion.sa.signature.template.list</field>
<field name="model">fusion.sa.signature.template</field>
<field name="arch" type="xml">
<list string="SA Signature Templates">
<field name="name"/>
<field name="sa_default_sig_page" string="Sig Page"/>
<field name="active" column_invisible="1"/>
</list>
</field>
</record>
<!-- SA Signature Template - Action -->
<record id="action_fusion_sa_signature_templates" model="ir.actions.act_window">
<field name="name">SA Signature Templates</field>
<field name="res_model">fusion.sa.signature.template</field>
<field name="view_mode">list,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a SA Mobility Signature Template
</p>
<p>
Define where client name, date, and signature are placed on ODSP approval forms.
Set once, used automatically for all SA Mobility cases.
</p>
</field>
</record>
<!-- Menu item under Configuration -->
<menuitem id="menu_fusion_sa_signature_templates"
name="SA Signature Templates"
parent="menu_adp_config"
action="action_fusion_sa_signature_templates"
sequence="45"/>
</odoo>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2024-2025 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
Part of the Fusion Claim Assistant product family.
-->
<odoo>
<!-- Add Fusion Central fields to Company Form -->
<record id="view_company_form_fusion_claims" model="ir.ui.view">
<field name="name">res.company.form.fusion.central</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page string="Fusion Central" name="fusion_claims">
<group string="Store/Location Information">
<field name="x_fc_store_address_1" placeholder="e.g., Main Store - 123 Street, City, Province, Postal"/>
<field name="x_fc_store_address_2" placeholder="e.g., Second Location - 456 Avenue, City, Province, Postal"/>
<field name="x_fc_company_tagline" placeholder="e.g., Your company slogan or tagline"/>
</group>
<group string="Payment Information">
<field name="x_fc_etransfer_email" placeholder="e.g., payments@yourcompany.com"/>
<field name="x_fc_cheque_payable_to" placeholder="Defaults to company name if empty"/>
</group>
<group string="Payment Terms (HTML)">
<field name="x_fc_payment_terms_html" nolabel="1" colspan="2"/>
</group>
<group string="Refund Policy">
<field name="x_fc_include_refund_page"/>
</group>
<group string="Refund Policy Content (HTML)" invisible="not x_fc_include_refund_page">
<field name="x_fc_refund_policy_html" nolabel="1" colspan="2"/>
</group>
</page>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,537 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2024-2025 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
Part of the Fusion Claim Assistant product family.
-->
<odoo>
<!-- Add Fusion Central Settings as a new app block -->
<record id="res_config_settings_view_form_fusion_claims" model="ir.ui.view">
<field name="name">res.config.settings.view.form.fusion.central</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="Fusion Claims" string="Fusion Claims" name="fusion_claims">
<h2>ADP Billing</h2>
<div class="row mt-4 o_settings_container">
<!-- ADP Vendor Code -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">ADP Vendor Code</span>
<div class="text-muted">Your ADP vendor/location code for claim submissions</div>
<div class="mt-2">
<field name="fc_vendor_code" placeholder="e.g., 1234567"/>
</div>
</div>
</div>
</div>
<h2>ADP Posting Schedule</h2>
<div class="row mt-4 o_settings_container">
<!-- Posting Schedule Configuration -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Posting Cycle</span>
<div class="text-muted">Configure the bi-weekly ADP posting schedule</div>
<div class="mt-2">
<div class="row mb-2">
<label for="fc_adp_posting_base_date" class="col-5 col-form-label">Base Posting Date</label>
<div class="col-7">
<field name="fc_adp_posting_base_date"/>
</div>
</div>
<div class="row mb-2">
<label for="fc_adp_posting_frequency_days" class="col-5 col-form-label">Frequency (Days)</label>
<div class="col-7">
<field name="fc_adp_posting_frequency_days"/>
</div>
</div>
</div>
<div class="alert alert-info mt-3" role="alert">
<strong>Schedule Info:</strong>
<ul class="mb-0 mt-1">
<li>Submission Deadline: Wednesday 6 PM before posting day</li>
<li>Payment Processed: Posting day + 7 days</li>
<li>Payment Received: Posting day + ~10 days</li>
</ul>
</div>
</div>
</div>
<!-- Reminder Recipients -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Automatic Reminders</span>
<div class="text-muted">Configure who receives ADP billing reminders</div>
<div class="mt-2">
<div class="row mb-2">
<label for="fc_adp_billing_reminder_user_id" class="col-12 col-form-label">
Billing Deadline Person
</label>
<div class="col-12">
<field name="fc_adp_billing_reminder_user_id"
domain="[('share', '=', False)]"
placeholder="Select user for billing reminders..."/>
<div class="text-muted small">Reminded on Monday to complete billing by Wednesday 6 PM</div>
</div>
</div>
<div class="row mt-3">
<label for="fc_adp_correction_reminder_user_ids" class="col-12 col-form-label">
Correction Alert Recipients
</label>
<div class="col-12">
<field name="fc_adp_correction_reminder_user_ids"
widget="many2many_tags"
domain="[('share', '=', False)]"
placeholder="Select users for correction alerts..."/>
<div class="text-muted small">Notified when invoices need correction/resubmission</div>
</div>
</div>
</div>
</div>
</div>
</div>
<h2>Email Notifications</h2>
<div class="row mt-4 o_settings_container">
<!-- Enable/Disable Notifications -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="fc_enable_email_notifications"/>
</div>
<div class="o_setting_right_pane">
<label for="fc_enable_email_notifications"/>
<div class="text-muted">
Send automated email notifications when ADP workflow status changes
(assessment completed, application submitted, approved, denied, case closed, etc.)
</div>
</div>
</div>
<!-- Office CC Emails -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Office Notification Recipients</span>
<div class="text-muted">
These contacts will receive a copy (CC) of all automated ADP notifications
so the office staff can stay in the loop.
</div>
<div class="mt-2">
<field name="fc_office_notification_ids"
widget="many2many_tags"
domain="[('user_ids.share', '=', False)]"
options="{'no_create': True}"/>
</div>
</div>
</div>
<!-- Application Reminder Days -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Application Reminders</span>
<div class="text-muted">
Automated reminders to therapist to submit the ADP application.
</div>
<div class="mt-2 row">
<div class="col-4">
<field name="fc_application_reminder_days"/>
</div>
<div class="col-8 pt-2 text-muted">days after assessment (first reminder)</div>
</div>
<div class="mt-2 row">
<div class="col-4">
<field name="fc_application_reminder_2_days"/>
</div>
<div class="col-8 pt-2 text-muted">days after first reminder (second reminder)</div>
</div>
</div>
</div>
</div>
<!-- Workflow Lock Settings -->
<h2 class="mt-4">Workflow Settings</h2>
<div class="row mt-4 o_settings_container">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="fc_allow_sale_type_override"/>
</div>
<div class="o_setting_right_pane">
<label for="fc_allow_sale_type_override"/>
<div class="text-muted">
Allow changing Sale Type even after application is submitted.
Use this for cases where additional benefits (ODSP, etc.) are discovered.
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="fc_allow_document_lock_override"/>
</div>
<div class="o_setting_right_pane">
<label for="fc_allow_document_lock_override"/>
<div class="text-muted">
Allow users in the "Document Lock Override" group to edit locked documents
on old cases. Turn this OFF once all legacy cases are processed.
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Designated Vendor Signer</span>
<div class="text-muted">
The user who signs Page 12 on behalf of the company.
</div>
<div class="mt-2">
<field name="fc_designated_vendor_signer"
domain="[('share', '=', False)]"/>
</div>
</div>
</div>
</div>
<h2>External APIs</h2>
<div class="row mt-4 o_settings_container">
<!-- Google Maps API Key -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Google Maps API</span>
<div class="text-muted">
API key for Google Maps Places autocomplete in address fields (accessibility assessments, etc.)
</div>
<div class="mt-2">
<field name="fc_google_maps_api_key" placeholder="Enter your Google Maps API Key" password="True"/>
</div>
<div class="alert alert-info mt-2" role="alert">
<i class="fa fa-info-circle"/> Enable the "Places API" in your Google Cloud Console for address autocomplete.
</div>
</div>
</div>
</div>
<h2>AI Client Intelligence</h2>
<div class="row mt-4 o_settings_container">
<!-- AI API Key -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">AI API Key</span>
<div class="text-muted">
OpenAI API key for Client Intelligence chat and AI analysis features.
</div>
<div class="mt-2">
<field name="fc_ai_api_key" placeholder="sk-..." password="True"/>
</div>
</div>
</div>
<!-- AI Model -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">AI Model</span>
<div class="text-muted">
Which AI model to use for client intelligence queries.
</div>
<div class="mt-2">
<field name="fc_ai_model"/>
</div>
</div>
</div>
<!-- Auto XML Parse -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="fc_auto_parse_xml"/>
</div>
<div class="o_setting_right_pane">
<label for="fc_auto_parse_xml"/>
<div class="text-muted">
Automatically parse ADP XML files when uploaded to sale orders
and create/update client profiles.
</div>
</div>
</div>
</div>
<h2>Technician Management</h2>
<div class="row mt-4 o_settings_container">
<!-- Store Hours -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Store / Scheduling Hours</span>
<div class="text-muted">
Operating hours for technician task scheduling. Tasks can only be booked
within these hours. Calendar view is also restricted to this range.
</div>
<div class="mt-2 d-flex align-items-center gap-2">
<field name="fc_store_open_hour" widget="float_time" style="max-width: 100px;"/>
<span>to</span>
<field name="fc_store_close_hour" widget="float_time" style="max-width: 100px;"/>
</div>
</div>
</div>
<!-- Distance Matrix Toggle -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="fc_google_distance_matrix_enabled"/>
</div>
<div class="o_setting_right_pane">
<label for="fc_google_distance_matrix_enabled"/>
<div class="text-muted">
Calculate travel time between technician tasks using Google Distance Matrix API.
Requires Google Maps API key above with Distance Matrix API enabled.
</div>
</div>
</div>
<!-- Start Address (Company Default / Fallback) -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Default HQ / Fallback Address</span>
<div class="text-muted">
Company default start location used when a technician has no personal
start address set. Each technician can set their own start location
in their user profile or from the portal.
</div>
<div class="mt-2">
<field name="fc_technician_start_address" placeholder="e.g. 123 Main St, Brampton, ON"/>
</div>
</div>
</div>
<!-- Location History Retention -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Location History Retention</span>
<div class="text-muted">
How many days to keep technician GPS location history before automatic cleanup.
</div>
<div class="mt-2 d-flex align-items-center gap-2">
<field name="fc_location_retention_days" placeholder="30" style="max-width: 80px;"/>
<span class="text-muted">days</span>
</div>
<div class="text-muted small mt-1">
Leave empty = 30 days. Enter 0 = delete at end of each day. 1+ = keep that many days.
</div>
</div>
</div>
</div>
<h2>Push Notifications</h2>
<div class="row mt-4 o_settings_container">
<!-- Push Enable -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="fc_push_enabled"/>
</div>
<div class="o_setting_right_pane">
<label for="fc_push_enabled"/>
<div class="text-muted">
Send web push notifications to technicians about upcoming tasks.
Requires VAPID keys (auto-generated on first save if empty).
</div>
</div>
</div>
<!-- Advance Minutes -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Notification Advance Time</span>
<div class="text-muted">
Send push notification this many minutes before a scheduled task.
</div>
<div class="mt-2">
<field name="fc_push_advance_minutes"/> minutes
</div>
</div>
</div>
<!-- VAPID Public Key -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">VAPID Public Key</span>
<div class="mt-2">
<field name="fc_vapid_public_key" placeholder="Auto-generated"/>
</div>
</div>
</div>
<!-- VAPID Private Key -->
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">VAPID Private Key</span>
<div class="mt-2">
<field name="fc_vapid_private_key" password="True" placeholder="Auto-generated"/>
</div>
</div>
</div>
</div>
<h2>March of Dimes</h2>
<div class="row mt-4 o_settings_container">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Default MOD Email</span>
<div class="text-muted">
Email used for sending initial quotations and documents to March of Dimes.
</div>
<div class="mt-2">
<field name="fc_mod_default_email" placeholder="hvmp@marchofdimes.ca"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">March of Dimes Vendor Code</span>
<div class="text-muted">
Your vendor code assigned by March of Dimes.
</div>
<div class="mt-2">
<field name="fc_mod_vendor_code" placeholder="e.g. TRD0001234"/>
</div>
</div>
</div>
</div>
<h2>Twilio SMS</h2>
<div class="row mt-4 o_settings_container">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="fc_twilio_enabled"/>
</div>
<div class="o_setting_right_pane">
<label for="fc_twilio_enabled"/>
<div class="text-muted">
Send SMS confirmations for assessment bookings and key status updates via Twilio.
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Twilio Phone Number</span>
<div class="mt-2">
<field name="fc_twilio_phone_number" placeholder="+1234567890"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Account SID</span>
<div class="mt-2">
<field name="fc_twilio_account_sid" password="True"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Auth Token</span>
<div class="mt-2">
<field name="fc_twilio_auth_token" password="True"/>
</div>
</div>
</div>
</div>
<h2>March of Dimes Follow-Up</h2>
<div class="row mt-4 o_settings_container">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Follow-up Interval</span>
<div class="text-muted">
Days between follow-up reminders for MOD cases awaiting funding.
</div>
<div class="mt-2">
<field name="fc_mod_followup_interval_days"/> days
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Auto-Email Escalation Delay</span>
<div class="text-muted">
Days after a follow-up activity is overdue before sending an automatic email to the client.
</div>
<div class="mt-2">
<field name="fc_mod_followup_escalation_days"/> days
</div>
</div>
</div>
</div>
<!-- ============================================================= -->
<!-- ODSP CONFIGURATION -->
<!-- ============================================================= -->
<h2>ODSP Configuration</h2>
<div class="row mt16 o_settings_container">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">SA Mobility Email</span>
<div class="text-muted">
Email address for SA Mobility submissions (can be changed if the government email changes).
</div>
<div class="mt-2">
<field name="fc_sa_mobility_email" placeholder="samobility@ontario.ca"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">SA Mobility Phone</span>
<div class="text-muted">
SA Mobility phone number for reference.
</div>
<div class="mt-2">
<field name="fc_sa_mobility_phone" placeholder="1-888-222-5099"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Default ODSP Office</span>
<div class="text-muted">
Default ODSP office contact for new ODSP cases.
</div>
<div class="mt-2">
<field name="fc_odsp_default_office_id"/>
</div>
</div>
</div>
</div>
<!-- Hidden fields for field mappings (still needed for ir.config_parameter storage) -->
<div class="d-none">
<field name="fc_field_sale_type"/>
<field name="fc_field_so_client_type"/>
<field name="fc_field_so_authorizer"/>
<field name="fc_field_invoice_type"/>
<field name="fc_field_inv_client_type"/>
<field name="fc_field_inv_authorizer"/>
<field name="fc_field_product_code"/>
<field name="fc_field_sol_serial"/>
<field name="fc_field_aml_serial"/>
<field name="fc_field_so_claim_number"/>
<field name="fc_field_so_client_ref_1"/>
<field name="fc_field_so_client_ref_2"/>
<field name="fc_field_so_delivery_date"/>
<field name="fc_field_so_adp_status"/>
<field name="fc_field_so_service_start"/>
<field name="fc_field_so_service_end"/>
<field name="fc_field_inv_claim_number"/>
<field name="fc_field_inv_client_ref_1"/>
<field name="fc_field_inv_client_ref_2"/>
<field name="fc_field_inv_delivery_date"/>
<field name="fc_field_inv_service_start"/>
<field name="fc_field_inv_service_end"/>
<field name="fc_field_sol_placement"/>
<field name="fc_field_aml_placement"/>
<field name="fc_field_product_adp_price"/>
<field name="fc_field_so_primary_serial"/>
<field name="fc_field_inv_primary_serial"/>
</div>
</app>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2024-2026 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
Part of the Fusion Claim Assistant product family.
-->
<odoo>
<!-- Add Contact Type + ODSP fields to Partner Form -->
<record id="view_partner_form_fusion_claims" model="ir.ui.view">
<field name="name">res.partner.form.fusion.claims</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<!-- Our Contact Type field above the address -->
<xpath expr="//span[@name='address_name']" position="before">
<field name="x_fc_contact_type" placeholder="Select contact type..."/>
</xpath>
<!-- ODSP section in notebook -->
<xpath expr="//notebook" position="inside">
<page string="ODSP" name="odsp_info"
invisible="x_fc_contact_type not in ('odsp_customer', 'adp_odsp_customer', 'odsp_agent', 'odsp_office')">
<group string="ODSP Information">
<group>
<field name="x_fc_odsp_member_id"
invisible="x_fc_contact_type == 'odsp_office'"/>
<field name="x_fc_case_worker_id"
invisible="x_fc_contact_type == 'odsp_office'"/>
</group>
<group>
<field name="x_fc_date_of_birth"
invisible="x_fc_contact_type == 'odsp_office'"/>
<field name="x_fc_healthcard_number"
invisible="x_fc_contact_type == 'odsp_office'"/>
</group>
</group>
<group string="ODSP Office Details"
invisible="x_fc_contact_type != 'odsp_office'">
<group>
<field name="x_fc_is_odsp_office" invisible="1"/>
<field name="email" string="Office Email"/>
<field name="phone" string="Office Phone"/>
</group>
</group>
</page>
</xpath>
</field>
</record>
<!-- Add Contact Type to list view -->
<record id="view_partner_tree_fusion_claims" model="ir.ui.view">
<field name="name">res.partner.tree.fusion.claims</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='phone']" position="after">
<field name="x_fc_contact_type" optional="hide"/>
</xpath>
</field>
</record>
<!-- Add Contact Type to search view -->
<record id="view_partner_search_fusion_claims" model="ir.ui.view">
<field name="name">res.partner.search.fusion.claims</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='type_company']" position="after">
<separator/>
<filter name="filter_odsp_customer" string="ODSP Customers"
domain="[('x_fc_contact_type', 'in', ['odsp_customer', 'adp_odsp_customer'])]"/>
<filter name="filter_odsp_office" string="ODSP Offices"
domain="[('x_fc_contact_type', '=', 'odsp_office')]"/>
</xpath>
</field>
</record>
</odoo>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Submission History Tree View -->
<record id="view_fusion_submission_history_tree" model="ir.ui.view">
<field name="name">fusion.submission.history.tree</field>
<field name="model">fusion.submission.history</field>
<field name="arch" type="xml">
<list string="Submission History" create="0">
<field name="submission_number"/>
<field name="submission_type"/>
<field name="submission_date"/>
<field name="submitted_by_id"/>
<field name="result" widget="badge"
decoration-success="result == 'accepted' or result == 'approved'"
decoration-danger="result == 'rejected' or result == 'denied'"
decoration-info="result == 'pending'"/>
<field name="result_date"/>
<field name="rejection_reason" optional="hide"/>
<field name="correction_notes" optional="hide"/>
</list>
</field>
</record>
<!-- Submission History Form View -->
<record id="view_fusion_submission_history_form" model="ir.ui.view">
<field name="name">fusion.submission.history.form</field>
<field name="model">fusion.submission.history</field>
<field name="arch" type="xml">
<form string="Submission History">
<sheet>
<div class="oe_title">
<h1>
<field name="display_name" readonly="1"/>
</h1>
</div>
<group>
<group string="Submission Details">
<field name="sale_order_id" readonly="1"/>
<field name="submission_number" readonly="1"/>
<field name="submission_type" readonly="1"/>
<field name="submission_date" readonly="1"/>
<field name="submitted_by_id" readonly="1"/>
</group>
<group string="Result">
<field name="result"/>
<field name="result_date"/>
<field name="rejection_reason" invisible="result != 'rejected'"/>
<field name="rejection_details" invisible="result != 'rejected'"/>
</group>
</group>
<group string="Documents Submitted" invisible="not final_application and not xml_file">
<group>
<field name="final_application" filename="final_application_filename"/>
<field name="final_application_filename" invisible="1"/>
</group>
<group>
<field name="xml_file" filename="xml_filename"/>
<field name="xml_filename" invisible="1"/>
</group>
</group>
<group string="Correction Notes" invisible="not correction_notes">
<field name="correction_notes" nolabel="1" colspan="2"/>
</group>
</sheet>
</form>
</field>
</record>
<!-- Action to view submission history -->
<record id="action_fusion_submission_history" model="ir.actions.act_window">
<field name="name">Submission History</field>
<field name="res_model">fusion.submission.history</field>
<field name="view_mode">list,form</field>
<field name="domain">[]</field>
<field name="context">{}</field>
</record>
</odoo>

View File

@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ================================================================== -->
<!-- LIST VIEW -->
<!-- ================================================================== -->
<record id="view_technician_location_list" model="ir.ui.view">
<field name="name">fusion.technician.location.list</field>
<field name="model">fusion.technician.location</field>
<field name="arch" type="xml">
<list string="Technician Locations" create="0" edit="0"
default_order="logged_at desc">
<field name="user_id" widget="many2one_avatar_user"/>
<field name="logged_at" string="Time"/>
<field name="latitude" optional="hide"/>
<field name="longitude" optional="hide"/>
<field name="accuracy" string="Accuracy (m)" optional="hide"/>
<field name="source"/>
</list>
</field>
</record>
<!-- ================================================================== -->
<!-- FORM VIEW (read-only) -->
<!-- ================================================================== -->
<record id="view_technician_location_form" model="ir.ui.view">
<field name="name">fusion.technician.location.form</field>
<field name="model">fusion.technician.location</field>
<field name="arch" type="xml">
<form string="Location Log" create="0" edit="0">
<sheet>
<group>
<group>
<field name="user_id"/>
<field name="logged_at"/>
<field name="source"/>
</group>
<group>
<field name="latitude"/>
<field name="longitude"/>
<field name="accuracy"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<!-- ================================================================== -->
<!-- SEARCH VIEW -->
<!-- ================================================================== -->
<record id="view_technician_location_search" model="ir.ui.view">
<field name="name">fusion.technician.location.search</field>
<field name="model">fusion.technician.location</field>
<field name="arch" type="xml">
<search string="Search Location Logs">
<field name="user_id" string="Technician"/>
<separator/>
<filter string="Today" name="filter_today"
domain="[('logged_at', '>=', context_today().strftime('%Y-%m-%d'))]"/>
<filter string="Last 7 Days" name="filter_7d"
domain="[('logged_at', '>=', (context_today() - datetime.timedelta(days=7)).strftime('%Y-%m-%d'))]"/>
<filter string="Last 30 Days" name="filter_30d"
domain="[('logged_at', '>=', (context_today() - datetime.timedelta(days=30)).strftime('%Y-%m-%d'))]"/>
<separator/>
<filter string="Technician" name="group_user" context="{'group_by': 'user_id'}"/>
<filter string="Date" name="group_date" context="{'group_by': 'logged_at:day'}"/>
<filter string="Source" name="group_source" context="{'group_by': 'source'}"/>
</search>
</field>
</record>
<!-- ================================================================== -->
<!-- ACTION -->
<!-- ================================================================== -->
<record id="action_technician_locations" model="ir.actions.act_window">
<field name="name">Location History</field>
<field name="res_model">fusion.technician.location</field>
<field name="view_mode">list,form</field>
<field name="search_view_id" ref="view_technician_location_search"/>
<field name="context">{
'search_default_filter_today': 1,
'search_default_group_user': 1,
}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No location data logged yet.
</p>
<p>Technician locations are automatically logged when they use the portal.</p>
</field>
</record>
<!-- ================================================================== -->
<!-- MAP VIEW (QWeb HTML with Google Maps) -->
<!-- ================================================================== -->
<record id="action_technician_location_map" model="ir.actions.act_url">
<field name="name">Technician Map</field>
<field name="url">/my/technician/admin/map</field>
<field name="target">self</field>
</record>
<!-- ================================================================== -->
<!-- MENU ITEMS (under Technician Management) -->
<!-- ================================================================== -->
<menuitem id="menu_technician_locations"
name="Location History"
parent="menu_technician_management"
action="action_technician_locations"
sequence="40"/>
<menuitem id="menu_technician_map"
name="Live Map"
parent="menu_technician_management"
action="action_technician_location_map"
sequence="45"/>
<!-- CRON: Cleanup old location records (runs daily) -->
<record id="ir_cron_cleanup_technician_locations" model="ir.cron">
<field name="name">Cleanup Old Technician Locations</field>
<field name="model_id" ref="model_fusion_technician_location"/>
<field name="state">code</field>
<field name="code">model._cron_cleanup_old_locations()</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="active">True</field>
</record>
</odoo>

View File

@@ -0,0 +1,448 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ================================================================== -->
<!-- SEQUENCE -->
<!-- ================================================================== -->
<record id="seq_technician_task" model="ir.sequence">
<field name="name">Technician Task</field>
<field name="code">fusion.technician.task</field>
<field name="prefix">TASK-</field>
<field name="padding">5</field>
<field name="number_increment">1</field>
</record>
<!-- ================================================================== -->
<!-- RES.USERS FORM EXTENSION - Field Staff toggle -->
<!-- ================================================================== -->
<record id="view_users_form_field_staff" model="ir.ui.view">
<field name="name">res.users.form.field.staff</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='share']" position="after">
<field name="x_fc_is_field_staff"/>
<field name="x_fc_start_address"
invisible="not x_fc_is_field_staff"
placeholder="e.g. 123 Main St, Brampton, ON"/>
</xpath>
</field>
</record>
<!-- ================================================================== -->
<!-- SEARCH VIEW -->
<!-- ================================================================== -->
<record id="view_technician_task_search" model="ir.ui.view">
<field name="name">fusion.technician.task.search</field>
<field name="model">fusion.technician.task</field>
<field name="arch" type="xml">
<search string="Search Tasks">
<!-- Quick Filters -->
<filter string="Today" name="filter_today"
domain="[('scheduled_date', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter string="Tomorrow" name="filter_tomorrow"
domain="[('scheduled_date', '=', (context_today() + datetime.timedelta(days=1)).strftime('%Y-%m-%d'))]"/>
<filter string="This Week" name="filter_this_week"
domain="[('scheduled_date', '>=', (context_today() - datetime.timedelta(days=context_today().weekday())).strftime('%Y-%m-%d')),
('scheduled_date', '&lt;=', (context_today() + datetime.timedelta(days=6-context_today().weekday())).strftime('%Y-%m-%d'))]"/>
<separator/>
<filter string="Scheduled" name="filter_scheduled" domain="[('status', '=', 'scheduled')]"/>
<filter string="En Route" name="filter_en_route" domain="[('status', '=', 'en_route')]"/>
<filter string="In Progress" name="filter_in_progress" domain="[('status', '=', 'in_progress')]"/>
<filter string="Completed" name="filter_completed" domain="[('status', '=', 'completed')]"/>
<filter string="Active" name="filter_active" domain="[('status', 'not in', ['cancelled', 'completed'])]"/>
<separator/>
<filter string="My Tasks" name="filter_my_tasks" domain="[('technician_id', '=', uid)]"/>
<filter string="Deliveries" name="filter_deliveries" domain="[('task_type', '=', 'delivery')]"/>
<filter string="Repairs" name="filter_repairs" domain="[('task_type', '=', 'repair')]"/>
<filter string="POD Required" name="filter_pod" domain="[('pod_required', '=', True)]"/>
<separator/>
<!-- Group By -->
<filter string="Technician" name="group_technician" context="{'group_by': 'technician_id'}"/>
<filter string="Date" name="group_date" context="{'group_by': 'scheduled_date'}"/>
<filter string="Status" name="group_status" context="{'group_by': 'status'}"/>
<filter string="Task Type" name="group_type" context="{'group_by': 'task_type'}"/>
<filter string="Client" name="group_client" context="{'group_by': 'partner_id'}"/>
</search>
</field>
</record>
<!-- ================================================================== -->
<!-- FORM VIEW -->
<!-- ================================================================== -->
<record id="view_technician_task_form" model="ir.ui.view">
<field name="name">fusion.technician.task.form</field>
<field name="model">fusion.technician.task</field>
<field name="arch" type="xml">
<form string="Technician Task">
<header>
<button name="action_start_en_route" type="object" string="En Route"
class="btn-primary" invisible="status != 'scheduled'"/>
<button name="action_start_task" type="object" string="Start Task"
class="btn-primary" invisible="status not in ('scheduled', 'en_route')"/>
<button name="action_complete_task" type="object" string="Complete"
class="btn-success" invisible="status not in ('in_progress', 'en_route')"/>
<button name="action_reschedule" type="object" string="Reschedule"
class="btn-warning" invisible="status not in ('scheduled', 'en_route')"/>
<button name="action_cancel_task" type="object" string="Cancel"
class="btn-danger" invisible="status in ('completed', 'cancelled')"
confirm="Are you sure you want to cancel this task?"/>
<button name="action_reset_to_scheduled" type="object" string="Reset to Scheduled"
invisible="status not in ('cancelled', 'rescheduled')"/>
<button string="Calculate Travel"
class="btn-secondary o_fc_calculate_travel" icon="fa-car"/>
<field name="status" widget="statusbar"
statusbar_visible="scheduled,en_route,in_progress,completed"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_view_sale_order" type="object"
class="oe_stat_button" icon="fa-file-text-o"
invisible="not sale_order_id">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">View Case</span>
</div>
</button>
</div>
<widget name="web_ribbon" title="Completed" bg_color="text-bg-success"
invisible="status != 'completed'"/>
<widget name="web_ribbon" title="Cancelled" bg_color="text-bg-danger"
invisible="status != 'cancelled'"/>
<div class="oe_title">
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<!-- Schedule Info Banner -->
<field name="schedule_info_html" nolabel="1" colspan="2"
invisible="not technician_id or not scheduled_date"/>
<!-- Previous Task / Travel Warning Banner -->
<field name="prev_task_summary_html" nolabel="1" colspan="2"
invisible="not technician_id or not scheduled_date"/>
<!-- Hidden fields for calendar sync and legacy -->
<field name="datetime_start" invisible="1"/>
<field name="datetime_end" invisible="1"/>
<field name="time_start_12h" invisible="1"/>
<field name="time_end_12h" invisible="1"/>
<group>
<group string="Assignment">
<field name="technician_id"
domain="[('x_fc_is_field_staff', '=', True)]"/>
<field name="task_type"/>
<field name="priority" widget="priority"/>
<field name="sale_order_id"/>
</group>
<group string="Schedule">
<field name="scheduled_date"/>
<field name="time_start" widget="float_time"
string="Start Time"/>
<field name="duration_hours" widget="float_time"
string="Duration"/>
<field name="time_end" widget="float_time"
string="End Time" readonly="1"
force_save="1"/>
</group>
</group>
<group>
<group string="Client">
<field name="partner_id"/>
<field name="partner_phone" widget="phone"/>
</group>
<group string="Location">
<field name="address_partner_id"/>
<field name="address_street"/>
<field name="address_street2" string="Unit/Suite #"/>
<field name="address_buzz_code"/>
<field name="address_city" invisible="1"/>
<field name="address_state_id" invisible="1"/>
<field name="address_zip" invisible="1"/>
<field name="address_lat" invisible="1"/>
<field name="address_lng" invisible="1"/>
</group>
</group>
<group>
<group string="Travel (Auto-Calculated)">
<field name="travel_time_minutes" readonly="1"/>
<field name="travel_distance_km" readonly="1"/>
<field name="travel_origin" readonly="1"/>
<field name="previous_task_id" readonly="1"/>
</group>
<group string="Options">
<field name="pod_required"/>
<field name="active" invisible="1"/>
</group>
</group>
<notebook>
<page string="Description" name="description">
<group>
<field name="description" placeholder="What needs to be done..."/>
</group>
<group>
<field name="equipment_needed" placeholder="Tools, parts, materials..."/>
</group>
</page>
<page string="Completion" name="completion">
<group>
<field name="completion_datetime"/>
<field name="completion_notes"/>
</group>
<group>
<field name="voice_note_transcription"/>
</group>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<!-- ================================================================== -->
<!-- LIST VIEW -->
<!-- ================================================================== -->
<record id="view_technician_task_list" model="ir.ui.view">
<field name="name">fusion.technician.task.list</field>
<field name="model">fusion.technician.task</field>
<field name="arch" type="xml">
<list string="Technician Tasks" decoration-success="status == 'completed'"
decoration-warning="status == 'in_progress'"
decoration-info="status == 'en_route'"
decoration-danger="status == 'cancelled'"
decoration-muted="status == 'rescheduled'"
default_order="scheduled_date, sequence, time_start">
<field name="name"/>
<field name="technician_id" widget="many2one_avatar_user"/>
<field name="task_type" decoration-bf="1"/>
<field name="scheduled_date"/>
<field name="time_start_display" string="Start"/>
<field name="time_end_display" string="End"/>
<field name="partner_id"/>
<field name="address_city"/>
<field name="travel_time_minutes" string="Travel (min)" optional="show"/>
<field name="status" widget="badge"
decoration-success="status == 'completed'"
decoration-warning="status == 'in_progress'"
decoration-info="status in ('scheduled', 'en_route')"
decoration-danger="status == 'cancelled'"/>
<field name="priority" widget="priority" optional="hide"/>
<field name="pod_required" optional="hide"/>
<field name="sale_order_id" optional="hide"/>
</list>
</field>
</record>
<!-- ================================================================== -->
<!-- KANBAN VIEW -->
<!-- ================================================================== -->
<record id="view_technician_task_kanban" model="ir.ui.view">
<field name="name">fusion.technician.task.kanban</field>
<field name="model">fusion.technician.task</field>
<field name="arch" type="xml">
<kanban default_group_by="status" class="o_kanban_small_column"
records_draggable="1" group_create="0">
<field name="color"/>
<field name="priority"/>
<field name="technician_id"/>
<field name="partner_id"/>
<field name="task_type"/>
<field name="scheduled_date"/>
<field name="time_start_display"/>
<field name="address_city"/>
<field name="travel_time_minutes"/>
<field name="status"/>
<templates>
<t t-name="card">
<div t-attf-class="oe_kanban_color_#{record.color.raw_value} oe_kanban_card oe_kanban_global_click">
<div class="oe_kanban_content">
<div class="o_kanban_record_top mb-1">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<field name="name"/>
</strong>
</div>
<field name="priority" widget="priority"/>
</div>
<div class="mb-1">
<span class="badge bg-primary me-1"><field name="task_type"/></span>
<span class="text-muted"><field name="scheduled_date"/> - <field name="time_start_display"/></span>
</div>
<div class="mb-1">
<i class="fa fa-user me-1"/><field name="partner_id"/>
</div>
<div class="text-muted small" t-if="record.address_city.raw_value">
<i class="fa fa-map-marker me-1"/><field name="address_city"/>
<t t-if="record.travel_time_minutes.raw_value">
<span class="ms-2"><i class="fa fa-car me-1"/><field name="travel_time_minutes"/> min</span>
</t>
</div>
<div class="o_kanban_record_bottom mt-2">
<div class="oe_kanban_bottom_left">
<field name="activity_ids" widget="kanban_activity"/>
</div>
<div class="oe_kanban_bottom_right">
<field name="technician_id" widget="many2one_avatar_user"/>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- ================================================================== -->
<!-- CALENDAR VIEW -->
<!-- ================================================================== -->
<record id="view_technician_task_calendar" model="ir.ui.view">
<field name="name">fusion.technician.task.calendar</field>
<field name="model">fusion.technician.task</field>
<field name="arch" type="xml">
<calendar string="Technician Schedule"
date_start="datetime_start" date_stop="datetime_end"
color="technician_id" mode="week" event_open_popup="1"
quick_create="0">
<!-- Displayed on the calendar card -->
<field name="partner_id"/>
<field name="task_type"/>
<field name="time_start_display" string="Start"/>
<field name="time_end_display" string="End"/>
<!-- Popover (hover/click) details -->
<field name="name"/>
<field name="technician_id" avatar_field="image_128"/>
<field name="address_display" string="Address"/>
<field name="travel_time_minutes" string="Travel (min)"/>
<field name="status"/>
<field name="duration_hours" widget="float_time" string="Duration"/>
</calendar>
</field>
</record>
<!-- ================================================================== -->
<!-- MAP VIEW (Enterprise web_map) -->
<!-- ================================================================== -->
<record id="view_technician_task_map" model="ir.ui.view">
<field name="name">fusion.technician.task.map</field>
<field name="model">fusion.technician.task</field>
<field name="arch" type="xml">
<map res_partner="address_partner_id" default_order="time_start"
routing="1" js_class="fusion_task_map">
<field name="partner_id" string="Client"/>
<field name="task_type" string="Type"/>
<field name="technician_id" string="Technician"/>
<field name="time_start_display" string="Start"/>
<field name="time_end_display" string="End"/>
<field name="status" string="Status"/>
<field name="travel_time_minutes" string="Travel (min)"/>
</map>
</field>
</record>
<!-- ================================================================== -->
<!-- ACTIONS -->
<!-- ================================================================== -->
<!-- Main Tasks Action (List/Kanban) -->
<record id="action_technician_tasks" model="ir.actions.act_window">
<field name="name">Technician Tasks</field>
<field name="res_model">fusion.technician.task</field>
<field name="view_mode">list,kanban,form,calendar,map</field>
<field name="search_view_id" ref="view_technician_task_search"/>
<field name="context">{'search_default_filter_active': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create your first technician task
</p>
<p>Schedule deliveries, repairs, and other field tasks for your technicians.</p>
</field>
</record>
<!-- Schedule Action (Map default) -->
<record id="action_technician_schedule" model="ir.actions.act_window">
<field name="name">Schedule</field>
<field name="res_model">fusion.technician.task</field>
<field name="view_mode">map,calendar,list,kanban,form</field>
<field name="search_view_id" ref="view_technician_task_search"/>
<field name="context">{'search_default_filter_active': 1}</field>
</record>
<!-- Map View Action (for app landing page) -->
<record id="action_technician_map_view" model="ir.actions.act_window">
<field name="name">Delivery Map</field>
<field name="res_model">fusion.technician.task</field>
<field name="view_mode">map,list,kanban,form,calendar</field>
<field name="search_view_id" ref="view_technician_task_search"/>
<field name="context">{'search_default_filter_active': 1}</field>
</record>
<!-- Today's Tasks Action -->
<record id="action_technician_tasks_today" model="ir.actions.act_window">
<field name="name">Today's Tasks</field>
<field name="res_model">fusion.technician.task</field>
<field name="view_mode">kanban,list,form,map</field>
<field name="search_view_id" ref="view_technician_task_search"/>
<field name="context">{'search_default_filter_today': 1, 'search_default_filter_active': 1}</field>
</record>
<!-- My Tasks Action -->
<record id="action_technician_my_tasks" model="ir.actions.act_window">
<field name="name">My Tasks</field>
<field name="res_model">fusion.technician.task</field>
<field name="view_mode">list,kanban,form,calendar,map</field>
<field name="search_view_id" ref="view_technician_task_search"/>
<field name="context">{'search_default_filter_my_tasks': 1, 'search_default_filter_active': 1}</field>
</record>
<!-- ================================================================== -->
<!-- MENU ITEMS -->
<!-- ================================================================== -->
<!-- Field Service - top-level menu (sequence 3 = first child = app default) -->
<menuitem id="menu_technician_management"
name="Field Service"
parent="fusion_claims.menu_adp_claims_root"
sequence="3"
groups="fusion_claims.group_fusion_claims_user,fusion_claims.group_field_technician"/>
<!-- Delivery Map - first item under Field Service = default landing view -->
<menuitem id="menu_fc_delivery_map"
name="Delivery Map"
parent="menu_technician_management"
action="action_technician_map_view"
sequence="5"
groups="fusion_claims.group_fusion_claims_user,fusion_claims.group_field_technician"/>
<menuitem id="menu_technician_schedule"
name="Schedule"
parent="menu_technician_management"
action="action_technician_schedule"
sequence="10"/>
<menuitem id="menu_technician_tasks"
name="Tasks"
parent="menu_technician_management"
action="action_technician_tasks"
sequence="20"/>
<menuitem id="menu_technician_tasks_today"
name="Today's Tasks"
parent="menu_technician_management"
action="action_technician_tasks_today"
sequence="15"/>
<menuitem id="menu_technician_my_tasks"
name="My Tasks"
parent="menu_technician_management"
action="action_technician_my_tasks"
sequence="25"
groups="fusion_claims.group_field_technician"/>
</odoo>