105 lines
6.5 KiB
XML
105 lines
6.5 KiB
XML
<?xml version="1.0"?>
|
|
<odoo>
|
|
<data>
|
|
|
|
<record model="ir.actions.act_window" id="leave_cancellation_action">
|
|
<field name="name">Leave Cancellation</field>
|
|
<field name="res_model">leave.cancellation</field>
|
|
|
|
<field name="view_mode">list,form</field>
|
|
</record>
|
|
<record model="ir.ui.view" id="leave_cancellation_form_view">
|
|
<field name="name">Leave Cancellation</field>
|
|
<field name="model">leave.cancellation</field>
|
|
<field name="arch" type="xml">
|
|
<form>
|
|
<header>
|
|
<button string="Submit" name="submit" type="object" invisible="state != 'draft'" class="oe_highlight"
|
|
groups="base.group_user"/>
|
|
|
|
<button string="Direct Manager Approve" name="confirm" type="object" invisible="state != 'submit'" class="oe_highlight"
|
|
groups="hr_base.group_division_manager"/>
|
|
<button string="Refuse" name="direct_manager_refused" invisible="state != 'submit'" type="object" class="oe_highlight"
|
|
groups="hr_base.group_division_manager" />
|
|
|
|
<!--button string="HR Manager" name="confirm" invisible="state != 'review'" type="object" class="oe_highlight"
|
|
groups="hr.group_hr_manager"/>
|
|
<button string="Refuse" name="refuse" invisible="state != 'review'" type="object" class="oe_highlight"
|
|
groups="hr.group_hr_manager" /-->
|
|
|
|
<button string="HR Manager Approve" name="approve" type="object" invisible="state != 'confirm'" class="oe_highlight"
|
|
groups="hr.group_hr_manager"/>
|
|
<button string="Refuse" name="refuse" invisible="state != 'confirm'" type="object" class="oe_highlight"
|
|
groups="hr.group_hr_manager"/>
|
|
|
|
<button string="Reset To Draft" name="draft" type="object" invisible="state not in ('refuse', 'approve')" class="oe_highlight"
|
|
groups="hr_holidays_community.group_hr_holidays_user,hr.group_hr_manager"
|
|
confirm="Are you sure to Reset To Draft This Record?"/>
|
|
<field name="state" widget="statusbar"/>
|
|
</header>
|
|
<sheet>
|
|
<group>
|
|
<group>
|
|
<field name="cancellation_type" readonly="state != 'draft'"/>
|
|
<field name="from_hr_department" string="Another Employee" readonly="state != 'draft'"/>
|
|
<field name="employee_id" string="Employee"
|
|
readonly="from_hr_department == False and state != 'draft'" required="1"/>
|
|
<field name="manager_id" invisible="1"/>
|
|
<field name="job_id" string="Job Title" readonly="1"/>
|
|
<field name="department_id" string="Department" readonly="1"/>
|
|
|
|
<field name="from_date" string="Last Leave Date" invisible="cancellation_type == 'cancel'" required="cancellation_type != 'cancel'" readonly="state != 'draft'" widget="date"/>
|
|
<field name="leave_cancellation_date" required="1" string="Leave Cancellation Date" invisible="1"
|
|
readonly="state != 'draft'" widget="date"/>
|
|
<field name="duration_canceled" string="Duration Canceled" readonly="1" force_save="1"/>
|
|
<field name="cause" string="Cause" required="1" readonly="state != 'draft'"/>
|
|
</group>
|
|
<group>
|
|
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
|
|
<field name="leave_request_id" string="Leave Request" required="1" widget="selection"
|
|
readonly="state != 'draft'"
|
|
domain = "[('employee_id', '=', employee_id),('state', '=', 'validate1'), ('type', '=', 'remove')]"/>
|
|
|
|
<field name="leave_date_from" string="Leave Date Start" widget="date" readonly="1" force_save="1"/>
|
|
<field name="leave_date_to" string="Leave Date End" widget="date" readonly="1" force_save="1"/>
|
|
<field name="reconcile_leave" invisible="1"/>
|
|
<field name="salary_rule_id"
|
|
invisible="reconcile_leave == False" required="reconcile_leave == True" readonly="state != 'draft'"/>
|
|
</group>
|
|
</group>
|
|
<notebook>
|
|
<page string="Attachments">
|
|
<field name="attachment_ids" readonly="state != 'draft'">
|
|
<list editable="bottom">
|
|
<field name="name" string="Attachment Name"/>
|
|
<field name="datas" string="File content"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
<!--Discuss widgets for history and communication -->
|
|
<chatter/>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record model="ir.ui.view" id="leave_cancellation_tree_view">
|
|
<field name="name">Leave Cancellation</field>
|
|
<field name="model">leave.cancellation</field>
|
|
<field name="arch" type="xml">
|
|
<list decoration-success="state=='approve'" decoration-danger="state == 'refuse'" decoration-info="state == 'draft'" string="Leave Cancellation">
|
|
<field name="employee_id" string="Employee"/>
|
|
<field name="department_id" />
|
|
<field name="leave_request_id" />
|
|
<field name="from_date" widget="date"/>
|
|
<!--field name="leave_cancellation_date" widget="date"/-->
|
|
<field name="duration_canceled"/>
|
|
<field name="state"/>
|
|
</list>
|
|
</field>
|
|
</record>
|
|
|
|
</data>
|
|
</odoo>
|