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.
282 lines
15 KiB
282 lines
15 KiB
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<odoo>
|
|
<!-- Form view for Bonus Request -->
|
|
<record id="bonus_request_view_form" model="ir.ui.view">
|
|
<field name="name">bonus.request.view.form</field>
|
|
<field name="model">bonus.request</field>
|
|
<field name="arch" type="xml">
|
|
<form>
|
|
<header>
|
|
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,department_approved,manager_approved"/>
|
|
<button name="action_confirm" type="object" string="Confirm"
|
|
attrs="{'invisible':[('state','!=','draft')]}" class="btn-primary"/>
|
|
<button name="action_department_approve" type="object" string="Approve by Department"
|
|
attrs="{'invisible':[('state','!=','confirmed')]}" class="btn-primary"
|
|
groups="employee_bonus_manager.employee_bonus_manager_department"/>
|
|
<button name="action_manager_approve" type="object" string="Approve by Manager"
|
|
attrs="{'invisible':[('state','!=','department_approved')]}" class="btn-primary"
|
|
groups="employee_bonus_manager.employee_bonus_manager_manager"/>
|
|
<button name="action_reject" type="object" string="Reject"
|
|
groups="employee_bonus_manager.employee_bonus_manager_department"
|
|
attrs="{'invisible':[('state','!=','confirmed')]}"/>
|
|
<button name="action_reject" type="object" string="Reject"
|
|
groups="employee_bonus_manager.employee_bonus_manager_manager"
|
|
attrs="{'invisible':[('state','!=','department_approved')]}"/>
|
|
<button name="action_reset_to_draft" type="object" string="Reset to Draft"
|
|
groups="employee_bonus_manager.employee_bonus_manager_department"
|
|
attrs="{'invisible':[('state','!=','rejected')]}"/>
|
|
</header>
|
|
<sheet>
|
|
<h1>
|
|
<field name="reference_no" readonly="1"/>
|
|
</h1>
|
|
<h2>
|
|
<field name="employee_id" attrs="{'readonly':[('state','!=','draft')]}"/>
|
|
</h2>
|
|
<group>
|
|
<group>
|
|
<field name="department_id"/>
|
|
<field name="job_id"/>
|
|
<field name="bonus_reason_id" attrs="{'readonly':[('state','!=','draft')]}"/>
|
|
</group>
|
|
<group>
|
|
<field name="create_date"/>
|
|
<field name="bonus_amount" widget="monetary" attrs="{'readonly':[('state','not in',('draft','confirmed'))]}"/>
|
|
<field name="currency_id" invisible="1"/>
|
|
</group>
|
|
</group>
|
|
<notebook>
|
|
<page string="Extra Information">
|
|
<group>
|
|
<group>
|
|
<field name="confirmed_date"/>
|
|
<field name="department_manager_id"/>
|
|
<field name="department_approved_date"/>
|
|
</group>
|
|
<group>
|
|
<field name="confirmed_user_id"/>
|
|
<field name="hr_manager_id"/>
|
|
<field name="manager_approved_date"/>
|
|
</group>
|
|
</group>
|
|
</page>
|
|
</notebook>
|
|
</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 for Bonus Requests -->
|
|
<record id="bonus_request_view_tree" model="ir.ui.view">
|
|
<field name="name">bonus.request.view.tree</field>
|
|
<field name="model">bonus.request</field>
|
|
<field name="arch" type="xml">
|
|
<tree default_order='create_date'
|
|
decoration-warning="state == 'draft'"
|
|
decoration-info="state == 'department_approved'"
|
|
decoration-success="state == 'manager_approved'"
|
|
decoration-danger="state == 'rejected'">
|
|
<field name="reference_no"/>
|
|
<field name="employee_id"/>
|
|
<field name="department_id"/>
|
|
<field name="job_id"/>
|
|
<field name="bonus_reason_id"/>
|
|
<field name="create_date" optional="show"/>
|
|
<field name="confirmed_date" optional="hide"/>
|
|
<field name="confirmed_user_id" optional="hide"/>
|
|
<field name="bonus_amount" widget="monetary"/>
|
|
<field name="currency_id" invisible="1"/>
|
|
<field name="department_approved_date" optional="hide"/>
|
|
<field name="manager_approved_date" optional="hide"/>
|
|
<field name="department_manager_id" optional="hide"/>
|
|
<field name="hr_manager_id" optional="hide"/>
|
|
<field name="state" string="State" widget="badge"
|
|
decoration-warning="state == 'draft'"
|
|
decoration-info="state == 'department_approved'"
|
|
decoration-success="state == 'manager_approved'"
|
|
decoration-danger="state == 'rejected'"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
<!-- Kanban view for Bonus Requests -->
|
|
<record id="bonus_request_view_kanban" model="ir.ui.view">
|
|
<field name="name">bonus.request.view.kanban</field>
|
|
<field name="model">bonus.request</field>
|
|
<field name="arch" type="xml">
|
|
<kanban class="o_bonus_request_kanban">
|
|
<field name="reference_no"/>
|
|
<field name="employee_id"/>
|
|
<field name="department_id"/>
|
|
<field name="job_id"/>
|
|
<field name="bonus_reason_id"/>
|
|
<field name="create_date"/>
|
|
<field name="confirmed_date" optional="show"/>
|
|
<field name="bonus_amount" widget="monetary"/>
|
|
<field name="currency_id" invisible="1"/>
|
|
<field name="department_approved_date" optional="show"/>
|
|
<field name="manager_approved_date" optional="show"/>
|
|
<field name="department_manager_id" optional="show"/>
|
|
<field name="hr_manager_id" optional="show"/>
|
|
<field name="state"/>
|
|
<templates>
|
|
<t t-name="kanban-box">
|
|
<div t-attf-class="oe_kanban_global_click">
|
|
<div class="oe_kanban_details">
|
|
<strong class="o_kanban_record_title">
|
|
<div class="float-end">
|
|
<field name="create_date"/>
|
|
</div>
|
|
<field name="employee_id"/>
|
|
<br/>
|
|
<field name="bonus_reason_id"/>
|
|
</strong>
|
|
<div>
|
|
<field name="bonus_amount" widget="monetary"/>
|
|
<field name="currency_id" invisible="1"/>
|
|
</div>
|
|
<div class="o_kanban_record_bottom flex-wrap">
|
|
<div class="oe_kanban_bottom_left">
|
|
<t t-esc="record.reference_no.value"/>
|
|
</div>
|
|
<div class="oe_kanban_bottom_right">
|
|
<t t-esc="record.state.value"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</templates>
|
|
</kanban>
|
|
</field>
|
|
</record>
|
|
<!-- Graph view for Bonus Requests -->
|
|
<record id="bonus_request_view_graph" model="ir.ui.view">
|
|
<field name="name">bonus.request.view.graph</field>
|
|
<field name="model">bonus.request</field>
|
|
<field name="arch" type="xml">
|
|
<graph string="Bonus Request">
|
|
<field name="employee_id"/>
|
|
<field name="state"/>
|
|
</graph>
|
|
</field>
|
|
</record>
|
|
<!-- Pivot view for Bonus Requests -->
|
|
<record id="bonus_request_view_pivot" model="ir.ui.view">
|
|
<field name="name">bonus.request.view.pivot</field>
|
|
<field name="model">bonus.request</field>
|
|
<field name="arch" type="xml">
|
|
<pivot string="Bonus Request">
|
|
<field name="employee_id"/>
|
|
<field name="state"/>
|
|
</pivot>
|
|
</field>
|
|
</record>
|
|
<!-- Calendar view for Bonus Requests -->
|
|
<record id="bonus_request_view_calendar" model="ir.ui.view">
|
|
<field name="name">bonus.request.view.calendar</field>
|
|
<field name="model">bonus.request</field>
|
|
<field name="priority" eval="2"/>
|
|
<field name="arch" type="xml">
|
|
<calendar string="Bonus Requests" create="0" mode="month" date_start="create_date" color="state" hide_time="true" event_limit="5">
|
|
<field name="employee_id"/>
|
|
<field name="department_id"/>
|
|
<field name="job_id"/>
|
|
<field name="bonus_reason_id"/>
|
|
<field name="create_date"/>
|
|
<field name="confirmed_date"/>
|
|
<field name="bonus_amount" widget="monetary"/>
|
|
<field name="currency_id" invisible="1"/>
|
|
<field name="department_approved_date"/>
|
|
<field name="manager_approved_date"/>
|
|
<field name="department_manager_id"/>
|
|
<field name="hr_manager_id"/>
|
|
</calendar>
|
|
</field>
|
|
</record>
|
|
<!-- Search view for Bonus Requests -->
|
|
<record id="bonus_request_view_search" model="ir.ui.view">
|
|
<field name="name">bonus.request.view.search</field>
|
|
<field name="model">bonus.request</field>
|
|
<field name="arch" type="xml">
|
|
<search>
|
|
<field name="reference_no"/>
|
|
<field name="employee_id"/>
|
|
<field name="department_id"/>
|
|
<field name="job_id"/>
|
|
<field name="bonus_reason_id"/>
|
|
<field name="create_date"/>
|
|
<field name="confirmed_date" optional="show"/>
|
|
<field name="bonus_amount" widget="monetary"/>
|
|
<field name="currency_id" invisible="1"/>
|
|
<field name="department_approved_date" optional="show"/>
|
|
<field name="manager_approved_date" optional="show"/>
|
|
<field name="department_manager_id" optional="show"/>
|
|
<field name="hr_manager_id" optional="show"/>
|
|
<field name="state"/>
|
|
<group expand="0" string="Group By">
|
|
<filter name="group_by_state" string="Status" context="{'group_by': 'state'}"/>
|
|
<filter name="group_by_employee_id" string="Employee" context="{'group_by': 'employee_id'}"/>
|
|
<filter name="group_by_create_date" string="Created Date" context="{'group_by': 'create_date'}"/>
|
|
<filter name="group_by_department_id" string="Department" context="{'group_by': 'department_id'}"/>
|
|
<filter name="group_by_job_id" string="Job" context="{'group_by': 'job_id'}"/>
|
|
</group>
|
|
<filter name="created_today" string="Created Today" domain="[('create_date', '=', context_today().strftime('%Y-%m-%d'))]"/>
|
|
<filter name="confirmed_today" string="Confirmed Today" domain="[('confirmed_date', '=', context_today().strftime('%Y-%m-%d'))]"/>
|
|
<filter name="department_approved_date_today" string="Department Approved: Today"
|
|
domain="[('department_approved_date', '=', context_today().strftime('%Y-%m-%d'))]"/>
|
|
<filter name="manager_approved_date_today" string="Manager Approved: Today"
|
|
domain="[('manager_approved_date', '=', context_today().strftime('%Y-%m-%d'))]"/>
|
|
<filter name="draft" string="Draft" domain="[('state', '=','draft' )]"/>
|
|
<filter name="confirmed" string="Confirmed" domain="[('state', '=','confirmed' )]"/>
|
|
<filter name="department_approved" string="Approval by Department" domain="[('state', '=','department_approved' )]"/>
|
|
<filter name="manager_approved" string="Approval by Manager" domain="[('state', '=','manager_approved' )]"/>
|
|
<filter name="rejected" string="Rejected" domain="[('state', '=','rejected' )]"/>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
<!-- Action window for Bonus Request -->
|
|
<record id="bonus_request_action" model="ir.actions.act_window">
|
|
<field name="name">Bonus Requests</field>
|
|
<field name="res_model">bonus.request</field>
|
|
<field name="view_mode">tree,kanban,graph,pivot,calendar,form</field>
|
|
<field name="search_view_id" ref="bonus_request_view_search"/>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
Create new bonus request
|
|
</p>
|
|
</field>
|
|
</record>
|
|
<!-- Action window for Bonus Request: for Department Approval -->
|
|
<record id="bonus_request_department_action" model="ir.actions.act_window">
|
|
<field name="name">Department Approval</field>
|
|
<field name="type">ir.actions.act_window</field>
|
|
<field name="res_model">bonus.request</field>
|
|
<field name="view_mode">tree,kanban,graph,pivot,calendar,form</field>
|
|
<field name="context">{'create': False}</field>
|
|
<field name="domain">[('state','=','confirmed')]</field>
|
|
<field name="search_view_id" ref="bonus_request_view_search"/>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
No requests found for department approval
|
|
</p>
|
|
</field>
|
|
</record>
|
|
<!-- Action window for Bonus Request: for Manager Approval -->
|
|
<record id="bonus_request_manager_action" model="ir.actions.act_window">
|
|
<field name="name">Manager Approval</field>
|
|
<field name="type">ir.actions.act_window</field>
|
|
<field name="res_model">bonus.request</field>
|
|
<field name="view_mode">tree,kanban,graph,pivot,calendar,form</field>
|
|
<field name="context">{'create': False}</field>
|
|
<field name="domain">[('state','=','department_approved')]</field>
|
|
<field name="search_view_id" ref="bonus_request_view_search"/>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
No requests found for Manager approval
|
|
</p>
|
|
</field>
|
|
</record>
|
|
</odoo>
|
|
|