159 lines
9.3 KiB
XML
159 lines
9.3 KiB
XML
<?xml version="1.0"?>
|
|
<odoo>
|
|
<data>
|
|
|
|
<menuitem parent="hr.menu_hr_root" name="Ticketing" id="hr_employee_ticket_menu" sequence="11"/>
|
|
|
|
<record id="hr_ticket_request_action" model="ir.actions.act_window">
|
|
<field name="name">Ticket Request</field>
|
|
<field name="res_model">hr.ticket.request</field>
|
|
<field name="view_mode">list,form</field>
|
|
</record>
|
|
|
|
<record model="ir.ui.view" id="hr_ticket_request_form">
|
|
<field name="name">hr.ticket.request.form</field>
|
|
<field name="model">hr.ticket.request</field>
|
|
<field name="arch" type="xml">
|
|
<form string="ticket request">
|
|
<header>
|
|
<button name="submit" invisible="state != 'draft'" string="Submit" type="object" class="oe_highlight"/>
|
|
|
|
<button name="review" invisible="state != 'submit'" string="Direct Manager" type="object" class="oe_highlight"
|
|
groups="hr_base.group_division_manager"/>
|
|
<button name="refuse" invisible="state != 'submit'" string="Refuse" type="object" class="oe_highlight"
|
|
groups="hr_base.group_division_manager"/>
|
|
|
|
<button name="confirm" invisible="state != 'review'" string="Government Relations" type="object"
|
|
class="oe_highlight"
|
|
groups="hr_base.group_government_relations"/>
|
|
<button name="refuse" invisible="state != 'review'" string="Refuse" type="object" class="oe_highlight"
|
|
groups="hr_base.group_government_relations"/>
|
|
|
|
<button name="action_done" invisible="state != 'confirm'" string="HR Manager" type="object"
|
|
class="oe_highlight"
|
|
groups="hr.group_hr_manager"/>
|
|
<button name="refuse" invisible="state != 'confirm'" string="Refuse" type="object" class="oe_highlight"
|
|
groups="hr.group_hr_manager"/>
|
|
|
|
<button name="re_draft" string="Re-Draft" type="object" class="oe_highlight"
|
|
invisible="state not in ('refuse', 'done')"
|
|
groups="hr.group_hr_manager" confirm="Are you sure to Rest To Draft This Record?"/>
|
|
|
|
<field name="state" widget="statusbar"/>
|
|
</header>
|
|
<sheet>
|
|
<group>
|
|
<group>
|
|
<field name="leave_ticket" invisible="1"/>
|
|
<field name="request_date" readonly="state != 'draft'"
|
|
required="1"/>
|
|
<field name="from_hr" readonly="state != 'draft'"/>
|
|
<field name="employee_id" required="1"
|
|
readonly="from_hr == False and state != 'draft'"/>
|
|
<field name="job_id" string="Job" readonly="1"/>
|
|
<field name="nationality_id" string="Nationality" readonly="1"/>
|
|
<field name="passport_no" string="Passport Number" readonly="1"/>
|
|
<field name="passport_issue_place" invisible="1"/>
|
|
<field name="passport_issue_date" invisible="1"/>
|
|
<field name="passport_expiry_date" string="Passport Expiration"
|
|
readonly="1"/>
|
|
</group>
|
|
<group>
|
|
<field name="request_for" required="1"
|
|
readonly="state != 'draft'"/>
|
|
<field name="request_type"
|
|
required="state in ('draft','review')" readonly="state not in ('draft','review')"/>
|
|
<field name="mission_check" string="Mission/Training Not Holiday?"
|
|
readonly="state != 'draft'"/>
|
|
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
|
|
</group>
|
|
</group>
|
|
<group>
|
|
<group>
|
|
<field name="ticket_check" invisible="1"/>
|
|
<field name="air_line"
|
|
invisible="ticket_check == False" required="ticket_check == True and state == 'review'" readonly="state != 'review'"/>
|
|
<field name="ticket_degree"
|
|
invisible="ticket_check == False" required="ticket_check == True and state == 'review'" readonly="state != 'review'"/>
|
|
<field name="travel_agent"
|
|
invisible="ticket_check == False" required="ticket_check == True and state == 'review'" readonly="state != 'review'"/>
|
|
<field name="cost_of_tickets"
|
|
help="The Amount of the Ticket is calculated according the type of request or the class of the ticket destination"
|
|
required="state == 'review'" readonly="state != 'review'"/>
|
|
<field name="journal_id"
|
|
required="cost_of_tickets > 0 and state == 'confirm'" readonly="state != 'confirm'"/>
|
|
<field name="move_id" string="Account move" readonly="1"/>
|
|
</group>
|
|
<group>
|
|
<field name="destination"
|
|
required="state in ('draft','review')" readonly="state not in ('draft','review')"/>
|
|
<field name="ticket_date"
|
|
required="state == 'review'" readonly="state != 'review'"/>
|
|
</group>
|
|
</group>
|
|
|
|
<notebook>
|
|
|
|
<page string="Dependants"
|
|
invisible="request_for == 'employee'">
|
|
<field name="employee_dependant">
|
|
<list string="Employee Dependants">
|
|
<field name="name" required="1"/>
|
|
<field name="age" required="1"/>
|
|
<field name="gender" required="1"/>
|
|
<field name="relation" required="1"/>
|
|
<field name="passport_no" required="1"/>
|
|
<field name="nationality" string="Nationality" required="1"/>
|
|
<field name="birthday" string="BirthDay" required="1"/>
|
|
<field name="birthday" string="BirthDay" required="1"/>
|
|
<field name="contract_id" invisible="1"/>
|
|
<field name="has_ticket"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
|
|
<page string="Attachments">
|
|
<field name="attach_ids" readonly="state != 'draft'">
|
|
<list string="Attachment" editable="bottom">
|
|
<field name="name" required="1"/>
|
|
<field name="datas" required="1"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
|
|
<page string="Notes">
|
|
<separator string="Notes"/>
|
|
<field name="note" readonly="state != 'draft'" nolabel="1"/>
|
|
</page>
|
|
|
|
</notebook>
|
|
</sheet>
|
|
<chatter/>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="hr_ticket_request_tree_view" model="ir.ui.view">
|
|
<field name="name">hr.ticket.request.tree</field>
|
|
<field name="model">hr.ticket.request</field>
|
|
<field name="arch" type="xml">
|
|
<list decoration-danger="state == 'refuse'" decoration-info="state == 'draft'"
|
|
decoration-success="state=='done'"
|
|
string="ticket request">
|
|
<field name="employee_id" string="Employee"/>
|
|
<field name="request_for" string="Request For"/>
|
|
<field name="request_type" string="Request Type"/>
|
|
<field name="state" string="Status"/>
|
|
|
|
</list>
|
|
</field>
|
|
</record>
|
|
|
|
<menuitem parent="hr_employee_ticket_menu" id="hr_ticket_request_menu" name="Ticket Request"
|
|
sequence="1" action="hr_ticket_request_action"/>
|
|
|
|
<menuitem parent="hr_employee_ticket_menu" name="Ticketing Settings" id="hr_employee_ticket_settining_menu"
|
|
sequence="2" groups="hr.group_hr_user"/>
|
|
</data>
|
|
</odoo>
|