Files
odoo_source/addons/hr_attendance/views/hr_employee_view.xml
T
Alexandre Kühn a87d761fdb [IMP] core: menu tip ux/ui improvement
We would like to make the "no item found" screens more appealing.

Before this commit, it shows a small help tip in the top-left
corner of the screen, just below the "Create" button.

With this commit, these help tips have been replaced by onboarding
screens, which consist of a picture and some text below, both of which
are horizontally centered.

The texts have been slightly changed, so that they are shorter and clearer.

Considered modules:

(A)
    account,
    account_asset,
    account_budget,
    account_test,
    account_voucher,
    analytic
(B)
    barcodes,
    base,
    base_automation,
    board
(C)
    calendar,
    contacts,
    crm
(D)
    delivery
(E)
    event
(F)
    fleet
(G)
    gamification,
    google_drive
(H)
    hr,
    hr_attendance,
    hr_contract,
    hr_expense,
    hr_gamification,
    hr_holidays,
    hr_payroll,
    hr_recruitment,
    hr_timesheet
(I)
    im_livechat
(L)
    l10n_fr_sale_closing,
    link_tracker,
    lunch
(M)
    mail,
    maintenance,
    mass_mailing,
    membership,
    mrp
(N)
    note
(P)
    payment,
    point_of_sale,
    post_mercury,
    pos_restaurant,
    product,
    project,
    purchase,
    purchase_requisition
(R)
    rating,
    repair,
    resource
(S)
    sale,
    sale_timesheet,
    sales_team,
    stock,
    stock_account,
    stock_landed_costs,
    stock_picking_batch,
    survey
(U)
    utm
(W)
    web,
    website,
    website_blog,
    website_customer,
    website_event_track,
    website_forum,
    website_quote,
    website_sale,
    website_sale_digital,
    website_slides
2018-01-18 21:43:29 +01:00

125 lines
6.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="view_employee_form_inherit_hr_attendance" model="ir.ui.view">
<field name="name">hr.employee</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="priority">10</field>
<field name="groups_id" eval="[(4,ref('hr_attendance.group_hr_attendance_user'))]"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='toggle_active']" position="before">
<field name="attendance_state" invisible="1"/>
<button name="%(hr_attendance_action_employee)d"
class="oe_stat_button"
type="action" attrs="{'invisible': [('attendance_state', '=', False)]}">
<div id="oe_hr_attendance_status" class="fa fa-fw fa-user o_button_icon oe_hr_attendance_status_green" attrs="{'invisible': [('attendance_state', '=', 'checked_out')]}"/>
<div id="oe_hr_attendance_status" class="fa fa-fw fa-user o_button_icon oe_hr_attendance_status_red" attrs="{'invisible': [('attendance_state', '=', 'checked_in')]}"/>
<div class="o_stat_info">
<span class="o_stat_text">Attendance</span>
</div>
</button>
</xpath>
<xpath expr="//group[@name='active_group']" position="after">
<group string='Attendance' groups="hr_attendance.group_hr_attendance_user">
<field name="barcode"/>
<field name="pin" groups="hr_attendance.group_hr_attendance_use_pin"/>
<field name="manual_attendance" attrs="{'invisible': [('user_id', '=', False)]}"/>
</group>
</xpath>
</field>
</record>
<!--Inherit employee search view -->
<record id="view_employee_filter_inherit_hr_attendance" model="ir.ui.view">
<field name="name">hr.employee.filter.inherit.attendance</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_filter"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='inactive']" position="after">
<filter string="Signed In" name="signed_in" domain="[('last_attendance_id.check_out', '=', False)]"/>
<filter string="Signed Out" name="signed_out" domain="['|', ('last_attendance_id', '=', False), ('last_attendance_id.check_out', '!=', False)]"/>
</xpath>
</field>
</record>
<!-- employee kanban view specifically for hr_attendance (to check in/out) -->
<record id="hr_employees_view_kanban" model="ir.ui.view">
<field name="name">hr.employee.kanban</field>
<field name="model">hr.employee</field>
<field name="priority">99</field>
<field name="arch" type="xml">
<kanban class="o_hr_employee_attendance_kanban" create="false">
<field name="attendance_state"/>
<field name="id"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o_kanban_image">
<img t-att-src="kanban_image('hr.employee', 'image_medium', record.id.raw_value)"/>
</div>
<div class="oe_kanban_details">
<div id="textbox">
<div class="pull-right" t-if="record.attendance_state.raw_value == 'checked_in'">
<span id="oe_hr_attendance_status" class="fa fa-user oe_hr_attendance_status_green"></span>
</div>
<div class="pull-right" t-if="record.attendance_state.raw_value == 'checked_out'">
<span id="oe_hr_attendance_status" class="fa fa-user oe_hr_attendance_status_red"></span>
</div>
<strong>
<field name="name"/>
</strong>
</div>
<ul>
<li t-if="record.job_id.raw_value"><field name="job_id"/></li>
<li t-if="record.work_location.raw_value"><field name="work_location"/></li>
</ul>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_employee_kanban_inherit_hr_attendance" model="ir.ui.view">
<field name="name">hr.employee</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
<field name="priority">1</field>
<field name="arch" type="xml">
<templates position="before">
<field name="attendance_state"/>
</templates>
<field name="name" position="replace">
<div>
<div class="pull-right" t-if="record.attendance_state.raw_value == 'checked_in'">
<span id="oe_hr_attendance_status" class="fa fa-user oe_hr_attendance_status_green"></span>
</div>
<div class="pull-right" t-if="record.attendance_state.raw_value == 'checked_out'">
<span id="oe_hr_attendance_status" class="fa fa-user oe_hr_attendance_status_red"></span>
</div>
<strong>
<field name="name" placeholder="Employee's Name"/>
</strong>
</div>
</field>
</field>
</record>
<record id="hr_employee_attendance_action_kanban" model="ir.actions.act_window">
<field name="name">Employees</field>
<field name="res_model">hr.employee</field>
<field name="view_mode">kanban</field>
<field name="view_id" ref="hr_employees_view_kanban"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new employee
</p><p>
Add a few employees to be able to select an employee here and perform his check in / check out.
To create employees go to the Employees menu.
</p>
</field>
</record>
</odoo>