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.
 
 
 
 
 

123 lines
5.6 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- Form view of employee fleet-->
<record model='ir.ui.view' id='employee_fleet_view_form'>
<field name="name">employee.fleet.view.form</field>
<field name="model">employee.fleet</field>
<field name="arch" type="xml">
<form string="Employee Fleet Request">
<header>
<button name='action_send' string="Send Request" type="object"
class='oe_highlight' invisible="state != 'draft'"/>
<button name='action_approve' string="Approve" type="object"
class='oe_highlight'
invisible="state != 'waiting'"
groups="hr.group_hr_manager,hr.group_hr_user"/>
<button name='action_reject' string="Reject" type="object"
invisible="state != 'waiting'"
groups="hr.group_hr_manager,hr.group_hr_user"/>
<button name='action_cancel' string="Cancel" type="object"
invisible="state not in ['draft', 'waiting']"/>
<button name='action_return' string="Return" type="object"
class='oe_highlight'
invisible="state != 'confirm'"
groups="hr.group_hr_manager,hr.group_hr_user"/>
<field name="state" widget="statusbar"
statusbar_visible="draft,waiting,confirm,return"/>
</header>
<sheet>
<h1>
<field name="name" readonly="1"/>
</h1>
<group>
<group>
<field name="employee_id"
options="{'no_create': True}"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="returned_date"
invisible="state != 'return'"/>
</group>
<group>
<field name="req_date"/>
<field name="fleet_id"
domain="[('check_availability','=',True)]"
options="{'no_create': True}"/>
<field name="purpose"/>
</group>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<!-- Tree view of employee fleet-->
<record model='ir.ui.view' id='employee_fleet_view_tree'>
<field name="name">employee.fleet.view.tree</field>
<field name="model">employee.fleet</field>
<field name="arch" type="xml">
<tree decoration-info="state == 'draft'"
decoration-muted="state == 'cancel'"
decoration-success="state == 'confirm'">
<field name="name"/>
<field name="employee_id"/>
<field name="fleet_id"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="state"/>
</tree>
</field>
</record>
<!-- Search view of employee fleet-->
<record model='ir.ui.view' id='employee_fleet_view_search'>
<field name="name">employee.fleet.view.search</field>
<field name="model">employee.fleet</field>
<field name="arch" type="xml">
<search string="Custody">
<field name="name"/>
<field name="employee_id"/>
<field name="fleet_id"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="state"/>
<separator/>
<group expand="0" string="Group By">
<filter string="Status" name="status" domain="[]"
context="{'group_by':'state'}"/>
<filter string="Employee" name="employee_id" domain="[]"
context="{'group_by':'employee_id'}"/>
<filter string="Vehicle" name="vehicle" domain="[]"
context="{'group_by':'fleet_id'}"/>
</group>
</search>
</field>
</record>
<!-- Employee fleet record-->
<record id="action_employee_fleet" model="ir.actions.act_window">
<field name="name">Vehicle Request</field>
<field name="res_model">employee.fleet</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="employee_fleet_view_search"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a New Vehicle Request.
</p>
</field>
</record>
<!-- Root menu for vehicle request-->
<menuitem id="employee_fleet_menu"
name="Vehicle Request"
parent="hr.menu_hr_root"
sequence="4"
groups="hr.group_hr_manager"/>
<!-- Sub menu for the vehicle request-->
<menuitem id="employee_fleet_sub_menu"
name="Vehicle Request"
parent="employee_fleet_menu"
sequence="1"
groups="hr.group_hr_manager"
action="action_employee_fleet"/>
</odoo>