You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
368 lines
19 KiB
368 lines
19 KiB
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<odoo>
|
|
<!--Form View of Fleet Rental Contract-->
|
|
<record id="fleet_rental_contract_view_form" model="ir.ui.view">
|
|
<field name="name">fleet.rental.contract.view.form</field>
|
|
<field name="model">fleet.rental.contract</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Rental Contract">
|
|
<header>
|
|
<field name="state" widget="statusbar"
|
|
options="{'clickable': '1'}"
|
|
statusbar_visible="new,in_progress,return"/>
|
|
<button string="Installment" name="action_installment"
|
|
type="object"
|
|
class="oe_highlight"/>
|
|
<button string="Damage Invoice"
|
|
name="action_damage_invoice"
|
|
type="object"
|
|
class="oe_highlight"
|
|
invisible="is_damaged_invoiced == True"/>
|
|
<button string="Cancellation Charges"
|
|
name="action_cancel_charges"
|
|
type="object"
|
|
class="oe_highlight"
|
|
invisible="state != 'cancel' or is_cancelled_invoiced == True"/>
|
|
<button string="Cancel"
|
|
name="action_cancel"
|
|
type="object"
|
|
class="oe_highlight"
|
|
invisible="state == 'cancel'"/>
|
|
</header>
|
|
<sheet>
|
|
<div class="oe_title">
|
|
<h1>
|
|
<field name="name" readonly="1"/>
|
|
</h1>
|
|
</div>
|
|
<div class="oe_button_box" name="button_box">
|
|
<button name="action_account_tab" string="Invoices"
|
|
type="object" icon="fa-pencil-square-o"
|
|
class="oe_stat_button">
|
|
<div class="o_form_field o_stat_info">
|
|
<span class="o_stat_text">
|
|
<span class="o_stat_text">Invoices
|
|
</span>
|
|
<field string="Invoices"
|
|
name="vehicle_to_invoice_count"/>
|
|
</span>
|
|
</div>
|
|
</button>
|
|
</div>
|
|
<group>
|
|
<group string="Customer Details">
|
|
<field name="customer_id"/>
|
|
<field name="email"/>
|
|
<field name="is_damaged_invoiced" invisible="1"/>
|
|
<field name="is_cancelled_invoiced" invisible="1"/>
|
|
</group>
|
|
</group>
|
|
<group string="Pick-Up & Drop-Off Details">
|
|
<group>
|
|
<field name="pickup_date"/>
|
|
<field name="pickup_location"/>
|
|
<field name="pickup_street"/>
|
|
<field name="pickup_city"/>
|
|
<field name="pickup_state_id"/>
|
|
<field name="pickup_zip"/>
|
|
<field name="pickup_country_id"/>
|
|
|
|
</group>
|
|
<group>
|
|
<field name="dropoff_date"/>
|
|
<field name="dropoff_location"/>
|
|
<field name="dropoff_street"/>
|
|
<field name="dropoff_city"/>
|
|
<field name="dropoff_state_id"/>
|
|
<field name="dropoff_zip"/>
|
|
<field name="dropoff_country_id"/>
|
|
</group>
|
|
</group>
|
|
<group string="Vehicle Details & Driver Details">
|
|
<group>
|
|
<field name="vehicle_id"/>
|
|
<field name="currency_id"/>
|
|
<field name="model"/>
|
|
<field name="transmission"/>
|
|
<field name="fuel_type"/>
|
|
<label for="last_odometer"/>
|
|
<div class="o_row">
|
|
<field name="last_odometer"/>
|
|
<field name="odometer_unit"/>
|
|
</div>
|
|
</group>
|
|
<group>
|
|
<group>
|
|
<field name="driver_required"/>
|
|
<field name="damage_amount" invisible="1"/>
|
|
<field name="damage_description"
|
|
invisible="1"/>
|
|
<field name="driver_id"
|
|
invisible="driver_required == False"/>
|
|
<field name="charge_type"
|
|
invisible="driver_required == False"/>
|
|
<field name="driver_charge"
|
|
invisible="driver_required == False"/>
|
|
|
|
</group>
|
|
</group>
|
|
</group>
|
|
<group string="Rent Details">
|
|
<group>
|
|
<field name="rent_type" widget="radio"
|
|
options="{'horizontal': true}"/>
|
|
<field name="rent_per_hour"
|
|
invisible="rent_type != 'hours'"/>
|
|
<field name="total_hours"
|
|
invisible="rent_type != 'hours'"/>
|
|
<field name="rent_per_day"
|
|
invisible="rent_type != 'days'"/>
|
|
<field name="total_days"
|
|
invisible="rent_type != 'days'"/>
|
|
<field name="rent_per_km"
|
|
invisible="rent_type != 'kilometers'"/>
|
|
<field name="total_km"
|
|
invisible="rent_type != 'kilometers'"/>
|
|
<field name="total_rental_charge"/>
|
|
<field name="is_extra_invoice_created"
|
|
invisible="1"/>
|
|
</group>
|
|
</group>
|
|
<group string="Payment Details">
|
|
<group>
|
|
<field name="payment_type" widget="radio"
|
|
options="{'horizontal': true}"/>
|
|
<field name="invoice_item_id"/>
|
|
</group>
|
|
</group>
|
|
<group string="Extra Charges">
|
|
<field name="is_extra_charge"/>
|
|
<field name="extra_per_hour"
|
|
invisible="rent_type in ['days','kilometers'] or is_extra_charge == False"/>
|
|
<field name="total_extra_hours"
|
|
invisible="rent_type in ['days','kilometers'] or is_extra_charge == False"/>
|
|
<field name="extra_per_day"
|
|
invisible="rent_type in ['hours','kilometers'] or is_extra_charge == False"/>
|
|
<field name="total_extra_days"
|
|
invisible="rent_type in ('hours','kilometers') or is_extra_charge == False"/>
|
|
<field name="extra_per_km"
|
|
invisible="rent_type in ('hours','days') or is_extra_charge == False"/>
|
|
<field name="total_extra_km"
|
|
invisible="rent_type in ('hours','days') or is_extra_charge == False"/>
|
|
<field name="total_extra_charge"
|
|
invisible="is_extra_charge == False"/>
|
|
</group>
|
|
<button string="Create Extra Charge Invoice"
|
|
name="action_create_extra_invoice"
|
|
class="oe_highlight"
|
|
type="object"
|
|
invisible="is_extra_charge == False"
|
|
/>
|
|
<group string="Responsible">
|
|
<field name="responsible_id"/>
|
|
</group>
|
|
<notebook>
|
|
<page string="Vehicle Payment Details">
|
|
<field name="rental_payment_plan_ids">
|
|
<tree string="Rent Lines" editable="bottom">
|
|
<field name="invoice_item_id"/>
|
|
<field name="payment_date"/>
|
|
<field name="payment_amount"/>
|
|
<field name="invoice_id"/>
|
|
<field name="payment_state"/>
|
|
<field name="is_invoiced"
|
|
column_invisible="True"/>
|
|
<button string="Create Invoice"
|
|
name="action_create_invoice"
|
|
type="object"
|
|
class="oe_highlight"
|
|
invisible="is_invoiced == True"/>
|
|
</tree>
|
|
</field>
|
|
</page>
|
|
<page string="Extra Services">
|
|
<field name="extra_service_ids">
|
|
<tree string="Extra Lines" editable="bottom">
|
|
<field name="product_id"/>
|
|
<field name="quantity"/>
|
|
<field name="description"/>
|
|
<field name="amount"/>
|
|
</tree>
|
|
</field>
|
|
<button string="Create Extra Invoice Charges"
|
|
name="action_extra_invoice_charge"
|
|
type="object"
|
|
class="oe_highlight"
|
|
invisible="is_extra_invoice_created == True"/>
|
|
</page>
|
|
<page string="Insurance Policy">
|
|
<field name="insurance_ids">
|
|
<tree string="Insurance Lines"
|
|
editable="bottom">
|
|
<field name="policy_number"/>
|
|
<field name="name"/>
|
|
<field name="description"/>
|
|
<field name="document"
|
|
filename="file_name"
|
|
widget="binary"/>
|
|
<field name="file_name"
|
|
column_invisible="True"/>
|
|
<field name="policy_amount"/>
|
|
</tree>
|
|
</field>
|
|
</page>
|
|
<page string="Images">
|
|
<field name="image_ids">
|
|
<kanban>
|
|
<field name="id" invisible="1"/>
|
|
<field name="image"/>
|
|
<templates>
|
|
<t t-name="kanban-box">
|
|
<div class="oe_kanban_global_click o_kanban_image_wrapper"
|
|
style="width: 78%;">
|
|
<img t-att-src="kanban_image('multi.image', 'image', record.id.raw_value)"
|
|
class="oe_kanban_avatar float-start me-3"
|
|
width="260" height="200"
|
|
alt="Vehicle Image"
|
|
t-att-title="record.id.value"/>
|
|
</div>
|
|
</t>
|
|
</templates>
|
|
</kanban>
|
|
</field>
|
|
</page>
|
|
<page string="Cancellation Policy"
|
|
invisible="state != 'cancel'">
|
|
<group>>
|
|
<group>
|
|
<field name="cancellation_policy_id"/>
|
|
</group>
|
|
<group>
|
|
<field name="cancellation_charge"/>
|
|
</group>
|
|
</group>
|
|
<notebook>
|
|
<page string="Terms Conditions">
|
|
<field name="cancellation_terms"/>
|
|
</page>
|
|
</notebook>
|
|
</page>
|
|
</notebook>
|
|
<group class="oe_subtotal_footer">
|
|
<field name="sign_date"/>
|
|
<field name="digital_sign" widget="signature"
|
|
class="oe_sign"
|
|
options="{'size': [260, 200]}"/>
|
|
</group>
|
|
</sheet>
|
|
<div class="oe_chatter">
|
|
<field name="message_follower_ids"
|
|
groups="base.group_user"/>
|
|
<field name="activity_ids"/>
|
|
<field name="message_ids" widget="mail_thread"/>
|
|
</div>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
<!--Tree View of Fleet Rental Contract-->
|
|
<record id="fleet_rental_contract_view_tree" model="ir.ui.view">
|
|
<field name="name">fleet.rental.contract.view.tree</field>
|
|
<field name="model">fleet.rental.contract</field>
|
|
<field name="type">tree</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="car_contract_result">
|
|
<field name="name"/>
|
|
<field name="customer_id" string="Customer"/>
|
|
<field name="vehicle_id"/>
|
|
<field name="total_rental_charge"/>
|
|
<field name="state" widget="badge"
|
|
decoration-info="state == 'draft'"
|
|
decoration-primary="state == 'confirmed'"
|
|
decoration-warning="state == 'in_progress'"
|
|
decoration-success="state == 'done'"
|
|
decoration-danger="state == 'cancelled'"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
<!--Kanban View of Fleet Rental Contract-->
|
|
<record id="fleet_rental_contract_view_kanban" model="ir.ui.view">
|
|
<field name="name">fleet.rental.contract.view.kanban</field>
|
|
<field name="model">fleet.rental.contract</field>
|
|
<field name="arch" type="xml">
|
|
<kanban default_group_by="state" class="o_kanban_small_column"
|
|
records_draggable="0">
|
|
<field name="name"/>
|
|
<field name="vehicle_id"/>
|
|
<field name="customer_id"/>
|
|
<field name="pickup_date"/>
|
|
<field name="dropoff_date"/>
|
|
<field name="total_rental_charge"/>
|
|
<field name="state"/>
|
|
<templates>
|
|
<t t-name="kanban-box">
|
|
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
|
|
<div class="o_kanban_record_top mb16">
|
|
<div class="o_kanban_record_headings mt4">
|
|
|
|
<strong class="o_kanban_record_title">
|
|
<field name="name"/>
|
|
</strong>
|
|
</div>
|
|
<strong>
|
|
<field name="total_rental_charge"
|
|
widget="monetary"/>
|
|
</strong>
|
|
</div>
|
|
<div class="o_kanban_record_bottom">
|
|
<div class="oe_kanban_bottom_left text-muted">
|
|
<field name="vehicle_id"/>
|
|
</div>
|
|
<div class="oe_kanban_bottom_right text-muted">
|
|
<field name="customer_id"/>
|
|
</div>
|
|
|
|
<div class="oe_kanban_bottom_left text-muted">
|
|
<field name="responsible_id"/>
|
|
</div>
|
|
</div>
|
|
<br/>
|
|
<div class="o_kanban_record_bottom mt16">
|
|
<small>
|
|
<field name="pickup_date"/>
|
|
to
|
|
<field name="dropoff_date"/>
|
|
</small>
|
|
<div class="oe_kanban_bottom_right">
|
|
<field name="state"
|
|
widget="label_selection"
|
|
options="{'classes': {'new': 'info', 'in_progress': 'warning', 'return': 'success', 'cancel': 'danger'}}"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</templates>
|
|
</kanban>
|
|
</field>
|
|
</record>
|
|
<!--Action View of Fleet Rental Contract-->
|
|
<record id="action_fleet_rental_contract" model="ir.actions.act_window">
|
|
<field name="name">Contracts</field>
|
|
<field name="res_model">fleet.rental.contract</field>
|
|
<field name="view_mode">kanban,tree,form</field>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
No contracts yet!
|
|
</p>
|
|
<p>
|
|
Start managing your rental contracts here.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
<!--Corresponding Menu-->
|
|
<menuitem
|
|
id="menu_contracts"
|
|
name="Contracts"
|
|
parent="vehicle_management_root"
|
|
action="action_fleet_rental_contract"
|
|
sequence="3"/>
|
|
</odoo>
|