[IMP] hr_holidays: add kanban views for leave and allocation
Purpose of this commit is to add kanban views for allocation and leave request. It is already possible to reach those views notably using the activities systray. Default view contains only the name which is quite sad. We therefore add real kanban views for both models. This commit is linked to task ID 1876795 and PR #26571.
This commit is contained in:
@@ -216,6 +216,78 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_leave_allocation_view_kanban" model="ir.ui.view">
|
||||
<field name="name">hr.leave.allocation.view.kanban</field>
|
||||
<field name="model">hr.leave.allocation</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile" create="0">
|
||||
<field name="employee_id"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<field name="name"/>
|
||||
<field name="number_of_days"/>
|
||||
<field name="can_approve"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_global_click">
|
||||
<div>
|
||||
<span>
|
||||
<img t-att-src="kanban_image('hr.employee', 'image_small', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value" width="40" height="40" class="oe_kanban_avatar float-left mr4"/>
|
||||
</span>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<strong class="o_kanban_record_title"><t t-esc="record.employee_id.value"/></strong>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<span class="float-right badge badge-secondary">
|
||||
<field name="state" widget="kanban_label_selection"
|
||||
options="{'classes': {'draft': 'default', 'confirm': 'default', 'validate': 'success', 'cancel': 'danger'}}"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 text-muted o_kanban_record_subtitle">
|
||||
<t t-esc="record.name.value"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_dropdown_kanban dropdown" groups="base.group_user">
|
||||
<a role="button" class="dropdown-toggle o-no-caret btn" data-toggle="dropdown" href="#" aria-label="Dropdown menu" title="Dropdown menu">
|
||||
<span class="fa fa-ellipsis-v"/>
|
||||
</a>
|
||||
<div class="dropdown-menu" role="menu">
|
||||
<a t-if="widget.editable" role="menuitem" type="edit" class="dropdown-item">Edit Task</a>
|
||||
<a t-if="widget.deletable" role="menuitem" type="delete" class="dropdown-item">Delete</a>
|
||||
<a t-if="record.can_approve.value" name="action_approve" type="object"
|
||||
role="menuitem" class="dropdown-item">Approve</a>
|
||||
<a t-if="record.can_approve.value" name="action_refuse" type="object"
|
||||
role="menuitem" class="dropdown-item">Refuse</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_kanban_record_bottom mt8 mb4">
|
||||
<div t-attf-class="oe_kanban_bottom_left #{record.date_from.value ? 'mt8 mb4': ''}">
|
||||
<table class="text-right" t-if="record.date_from.value">
|
||||
<tr>
|
||||
<td style="padding-bottom:4px"><small class="text-muted">from</small></td>
|
||||
<td style="padding:0 0 4px 4px"><t t-esc="record.date_from.value"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><small class="text-muted">to</small></td>
|
||||
<td style="padding-left:4px"><t t-esc="record.date_to.value"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div t-attf-class="oe_kanban_bottom_right #{record.date_from.value ? 'mt8': ''}">
|
||||
<span class="badge badge-pill"><t t-esc="record.number_of_days.value"/> days</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_leave_allocation_action_my" model="ir.actions.act_window">
|
||||
<field name="name">My Allocations</field>
|
||||
<field name="res_model">hr.leave.allocation</field>
|
||||
|
||||
@@ -64,6 +64,78 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_leave_view_kanban" model="ir.ui.view">
|
||||
<field name="name">hr.leave.view.kanban</field>
|
||||
<field name="model">hr.leave</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile" create="0">
|
||||
<field name="employee_id"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<field name="name"/>
|
||||
<field name="number_of_days"/>
|
||||
<field name="can_approve"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_global_click">
|
||||
<div>
|
||||
<span>
|
||||
<img t-att-src="kanban_image('hr.employee', 'image_small', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value" width="40" height="40" class="oe_kanban_avatar float-left mr4"/>
|
||||
</span>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<strong class="o_kanban_record_title"><t t-esc="record.employee_id.value"/></strong>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<span class="float-right badge badge-secondary">
|
||||
<field name="state" widget="kanban_label_selection"
|
||||
options="{'classes': {'draft': 'default', 'confirm': 'default', 'validate': 'success', 'cancel': 'danger'}}"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 text-muted o_kanban_record_subtitle">
|
||||
<t t-esc="record.name.value"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_dropdown_kanban dropdown" groups="base.group_user">
|
||||
<a role="button" class="dropdown-toggle o-no-caret btn" data-toggle="dropdown" href="#" aria-label="Dropdown menu" title="Dropdown menu">
|
||||
<span class="fa fa-ellipsis-v"/>
|
||||
</a>
|
||||
<div class="dropdown-menu" role="menu">
|
||||
<a t-if="widget.editable" role="menuitem" type="edit" class="dropdown-item">Edit Task</a>
|
||||
<a t-if="widget.deletable" role="menuitem" type="delete" class="dropdown-item">Delete</a>
|
||||
<a t-if="record.can_approve.value" name="action_approve" type="object"
|
||||
role="menuitem" class="dropdown-item">Approve</a>
|
||||
<a t-if="record.can_approve.value" name="action_refuse" type="object"
|
||||
role="menuitem" class="dropdown-item">Refuse</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_kanban_record_bottom mt8 mb4">
|
||||
<div t-attf-class="oe_kanban_bottom_left #{record.date_from.value ? 'mt8 mb4': ''}">
|
||||
<table class="text-right" t-if="record.date_from.value">
|
||||
<tr>
|
||||
<td style="padding-bottom:4px"><small class="text-muted">from</small></td>
|
||||
<td style="padding:0 0 4px 4px"><t t-esc="record.date_from.value"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><small class="text-muted">to</small></td>
|
||||
<td style="padding-left:4px"><t t-esc="record.date_to.value"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div t-attf-class="oe_kanban_bottom_right #{record.date_from.value ? 'mt8': ''}">
|
||||
<span class="badge badge-pill"><t t-esc="record.number_of_days.value"/> days</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_leave_view_calendar" model="ir.ui.view">
|
||||
<field name="name">hr.leave.view.calendar</field>
|
||||
<field name="model">hr.leave</field>
|
||||
|
||||
Reference in New Issue
Block a user