526 lines
25 KiB
XML
526 lines
25 KiB
XML
<?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')"
|
|
default_order="checkout_date desc, id desc">
|
|
<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="actual_return_date" optional="hide"/>
|
|
<field name="days_out"/>
|
|
<field name="days_overdue" optional="hide"/>
|
|
<field name="sales_rep_id" optional="hide"/>
|
|
<field name="checkout_condition" optional="hide"/>
|
|
<field name="return_condition" optional="hide"/>
|
|
<field name="sale_order_id" optional="hide"/>
|
|
<field name="state" widget="badge"
|
|
decoration-info="state == 'draft'"
|
|
decoration-success="state == 'checked_out'"
|
|
decoration-danger="state in ('overdue', 'lost')"
|
|
decoration-warning="state == 'rental_pending'"
|
|
decoration-muted="state in ('returned', 'converted_rental')"/>
|
|
</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_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">Sale Order</span>
|
|
</div>
|
|
</button>
|
|
<button name="action_view_partner" type="object"
|
|
class="oe_stat_button" icon="fa-user">
|
|
<div class="o_field_widget o_stat_info">
|
|
<span class="o_stat_text">Contact</span>
|
|
</div>
|
|
</button>
|
|
</div>
|
|
<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 string="Search Loaners">
|
|
<field name="name"/>
|
|
<field name="partner_id"/>
|
|
<field name="product_id"/>
|
|
<field name="lot_id" string="Serial Number"/>
|
|
<field name="sale_order_id"/>
|
|
<field name="sales_rep_id"/>
|
|
<separator/>
|
|
<!-- Status Filters -->
|
|
<filter string="Draft" name="filter_draft"
|
|
domain="[('state', '=', 'draft')]"/>
|
|
<filter string="Checked Out" name="filter_checked_out"
|
|
domain="[('state', '=', 'checked_out')]"/>
|
|
<filter string="Overdue" name="filter_overdue"
|
|
domain="[('state', '=', 'overdue')]"/>
|
|
<filter string="Rental Pending" name="filter_rental_pending"
|
|
domain="[('state', '=', 'rental_pending')]"/>
|
|
<filter string="Returned" name="filter_returned"
|
|
domain="[('state', '=', 'returned')]"/>
|
|
<filter string="Converted to Rental" name="filter_converted"
|
|
domain="[('state', '=', 'converted_rental')]"/>
|
|
<filter string="Lost" name="filter_lost"
|
|
domain="[('state', '=', 'lost')]"/>
|
|
<separator/>
|
|
<!-- Quick Filters -->
|
|
<filter string="Active Loaners" name="filter_active"
|
|
domain="[('state', 'in', ['checked_out', 'overdue', 'rental_pending'])]"/>
|
|
<filter string="Needs Attention" name="filter_attention"
|
|
domain="[('state', 'in', ['overdue', 'rental_pending'])]"/>
|
|
<filter string="My Loaners" name="filter_my_loaners"
|
|
domain="[('sales_rep_id', '=', uid)]"/>
|
|
<separator/>
|
|
<!-- Condition Filters -->
|
|
<filter string="Needs Repair (Checkout)" name="filter_checkout_repair"
|
|
domain="[('checkout_condition', '=', 'needs_repair')]"/>
|
|
<filter string="Damaged (Return)" name="filter_return_damaged"
|
|
domain="[('return_condition', 'in', ['needs_repair', 'damaged'])]"/>
|
|
<separator/>
|
|
<!-- Group By -->
|
|
<filter string="Status" name="group_state"
|
|
context="{'group_by': 'state'}"/>
|
|
<filter string="Client" name="group_client"
|
|
context="{'group_by': 'partner_id'}"/>
|
|
<filter string="Product" name="group_product"
|
|
context="{'group_by': 'product_id'}"/>
|
|
<filter string="Sales Rep" name="group_sales_rep"
|
|
context="{'group_by': 'sales_rep_id'}"/>
|
|
<filter string="Checkout Condition" name="group_checkout_condition"
|
|
context="{'group_by': 'checkout_condition'}"/>
|
|
<filter string="Return Condition" name="group_return_condition"
|
|
context="{'group_by': 'return_condition'}"/>
|
|
<filter string="Checkout Month" name="group_checkout_month"
|
|
context="{'group_by': 'checkout_date:month'}"/>
|
|
<filter string="Return Month" name="group_return_month"
|
|
context="{'group_by': 'actual_return_date:month'}"/>
|
|
</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 default_order="action_date desc, id desc">
|
|
<field name="action_date"/>
|
|
<field name="checkout_id"/>
|
|
<field name="partner_id" optional="show"/>
|
|
<field name="product_id" optional="show"/>
|
|
<field name="lot_id" optional="hide"/>
|
|
<field name="action" widget="badge"
|
|
decoration-info="action in ('create', 'note')"
|
|
decoration-success="action in ('checkout', 'return')"
|
|
decoration-warning="action in ('reminder_sent', 'overdue', 'rental_pending')"
|
|
decoration-danger="action in ('lost', 'condition_update')"/>
|
|
<field name="user_id"/>
|
|
<field name="notes" optional="show"/>
|
|
</list>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- History Search View -->
|
|
<record id="view_fusion_loaner_history_search" model="ir.ui.view">
|
|
<field name="name">fusion.loaner.history.search</field>
|
|
<field name="model">fusion.loaner.history</field>
|
|
<field name="arch" type="xml">
|
|
<search string="Search Loaner History">
|
|
<field name="checkout_id"/>
|
|
<field name="partner_id"/>
|
|
<field name="product_id"/>
|
|
<field name="lot_id" string="Serial Number"/>
|
|
<field name="user_id"/>
|
|
<separator/>
|
|
<!-- Action Type Filters -->
|
|
<filter string="Checkouts" name="filter_checkout"
|
|
domain="[('action', '=', 'checkout')]"/>
|
|
<filter string="Returns" name="filter_return"
|
|
domain="[('action', '=', 'return')]"/>
|
|
<filter string="Reminders" name="filter_reminders"
|
|
domain="[('action', '=', 'reminder_sent')]"/>
|
|
<filter string="Overdue" name="filter_overdue"
|
|
domain="[('action', '=', 'overdue')]"/>
|
|
<filter string="Rental Conversions" name="filter_rental"
|
|
domain="[('action', 'in', ['rental_pending', 'rental_converted'])]"/>
|
|
<filter string="Lost" name="filter_lost"
|
|
domain="[('action', '=', 'lost')]"/>
|
|
<separator/>
|
|
<!-- Group By -->
|
|
<filter string="Action Type" name="group_action"
|
|
context="{'group_by': 'action'}"/>
|
|
<filter string="Client" name="group_client"
|
|
context="{'group_by': 'partner_id'}"/>
|
|
<filter string="Product" name="group_product"
|
|
context="{'group_by': 'product_id'}"/>
|
|
<filter string="User" name="group_user"
|
|
context="{'group_by': 'user_id'}"/>
|
|
<filter string="Month" name="group_month"
|
|
context="{'group_by': 'action_date:month'}"/>
|
|
</search>
|
|
</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>
|
|
|
|
<!-- ===================================================================== -->
|
|
<!-- LOANER PRODUCTS VIEWS -->
|
|
<!-- ===================================================================== -->
|
|
|
|
<!-- Loaner Products List View -->
|
|
<record id="view_fusion_loaner_products_list" model="ir.ui.view">
|
|
<field name="name">product.template.loaner.list</field>
|
|
<field name="model">product.template</field>
|
|
<field name="arch" type="xml">
|
|
<list>
|
|
<field name="name"/>
|
|
<field name="x_fc_equipment_type" optional="show"/>
|
|
<field name="x_fc_wheelchair_category" optional="show"/>
|
|
<field name="x_fc_seat_width" optional="show"/>
|
|
<field name="x_fc_seat_depth" optional="show"/>
|
|
<field name="x_fc_seat_height" optional="hide"/>
|
|
<field name="x_fc_storage_location" optional="show"/>
|
|
<field name="x_fc_listing_type" optional="show"/>
|
|
<field name="x_fc_asset_number" optional="hide"/>
|
|
<field name="active" column_invisible="True"/>
|
|
</list>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Loaner Products Search View -->
|
|
<record id="view_fusion_loaner_products_search" model="ir.ui.view">
|
|
<field name="name">product.template.loaner.search</field>
|
|
<field name="model">product.template</field>
|
|
<field name="arch" type="xml">
|
|
<search string="Search Loaner Products">
|
|
<field name="name"/>
|
|
<field name="x_fc_equipment_type"/>
|
|
<field name="x_fc_asset_number"/>
|
|
<separator/>
|
|
<filter string="Owned" name="filter_owned"
|
|
domain="[('x_fc_listing_type', '=', 'owned')]"/>
|
|
<filter string="Borrowed" name="filter_borrowed"
|
|
domain="[('x_fc_listing_type', '=', 'borrowed')]"/>
|
|
<separator/>
|
|
<filter string="Archived" name="filter_archived"
|
|
domain="[('active', '=', False)]"/>
|
|
<separator/>
|
|
<filter string="Equipment Type" name="group_equipment_type"
|
|
context="{'group_by': 'x_fc_equipment_type'}"/>
|
|
<filter string="Wheelchair Category" name="group_wheelchair_category"
|
|
context="{'group_by': 'x_fc_wheelchair_category'}"/>
|
|
<filter string="Storage Location" name="group_storage_location"
|
|
context="{'group_by': 'x_fc_storage_location'}"/>
|
|
<filter string="Listing Type" name="group_listing_type"
|
|
context="{'group_by': 'x_fc_listing_type'}"/>
|
|
</search>
|
|
</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>
|
|
<field name="search_view_id" ref="view_fusion_loaner_checkout_search"/>
|
|
<field name="context">{'search_default_filter_active': 1}</field>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">No loaner checkouts yet</p>
|
|
<p>Track loaner equipment issued to clients during assessments or trials.</p>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="action_fusion_loaner_all" model="ir.actions.act_window">
|
|
<field name="name">All Loaners</field>
|
|
<field name="res_model">fusion.loaner.checkout</field>
|
|
<field name="view_mode">list,form</field>
|
|
<field name="search_view_id" ref="view_fusion_loaner_checkout_search"/>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">No loaner checkouts yet</p>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="action_fusion_loaner_overdue" model="ir.actions.act_window">
|
|
<field name="name">Overdue Loaners</field>
|
|
<field name="res_model">fusion.loaner.checkout</field>
|
|
<field name="view_mode">list,form</field>
|
|
<field name="search_view_id" ref="view_fusion_loaner_checkout_search"/>
|
|
<field name="context">{'search_default_filter_attention': 1}</field>
|
|
</record>
|
|
|
|
<record id="action_fusion_loaner_returned" model="ir.actions.act_window">
|
|
<field name="name">Returned Loaners</field>
|
|
<field name="res_model">fusion.loaner.checkout</field>
|
|
<field name="view_mode">list,form</field>
|
|
<field name="search_view_id" ref="view_fusion_loaner_checkout_search"/>
|
|
<field name="context">{'search_default_filter_returned': 1}</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>
|
|
<field name="search_view_id" ref="view_fusion_loaner_history_search"/>
|
|
</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="view_id" ref="view_fusion_loaner_products_list"/>
|
|
<field name="search_view_id" ref="view_fusion_loaner_products_search"/>
|
|
<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_all"
|
|
name="All Loaners"
|
|
parent="menu_loaner_root"
|
|
action="action_fusion_loaner_all"
|
|
sequence="15"/>
|
|
|
|
<menuitem id="menu_loaner_overdue"
|
|
name="Overdue / Attention"
|
|
parent="menu_loaner_root"
|
|
action="action_fusion_loaner_overdue"
|
|
sequence="18"/>
|
|
|
|
<menuitem id="menu_loaner_returned"
|
|
name="Returned"
|
|
parent="menu_loaner_root"
|
|
action="action_fusion_loaner_returned"
|
|
sequence="19"/>
|
|
|
|
<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>
|
|
<group>
|
|
<group string="Equipment Details">
|
|
<field name="x_fc_equipment_type"/>
|
|
<field name="x_fc_wheelchair_category"/>
|
|
<field name="x_fc_listing_type"/>
|
|
<field name="x_fc_asset_number"/>
|
|
</group>
|
|
<group string="Dimensions">
|
|
<field name="x_fc_seat_width"/>
|
|
<field name="x_fc_seat_depth"/>
|
|
<field name="x_fc_seat_height"/>
|
|
</group>
|
|
</group>
|
|
<group>
|
|
<group string="Location">
|
|
<field name="x_fc_storage_location"/>
|
|
</group>
|
|
</group>
|
|
<group string="Package Information">
|
|
<field name="x_fc_package_info" nolabel="1" colspan="2"/>
|
|
</group>
|
|
<group string="Security Deposit">
|
|
<group>
|
|
<field name="x_fc_security_deposit_type"/>
|
|
<field name="x_fc_security_deposit_amount"
|
|
invisible="x_fc_security_deposit_type != 'fixed'"/>
|
|
<field name="x_fc_security_deposit_percent"
|
|
invisible="x_fc_security_deposit_type != 'percentage'"/>
|
|
</group>
|
|
</group>
|
|
</page>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
|
|
</odoo>
|