Initial commit
This commit is contained in:
261
fusion_claims/views/fusion_loaner_views.xml
Normal file
261
fusion_claims/views/fusion_loaner_views.xml
Normal 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>
|
||||
Reference in New Issue
Block a user