[IMP] Various usability improvments on attendance and HR application,

- Print Badge report set as pdf instead of html
- Replace the 'Status' separator by 'Attendance' in HR Settings tab
- Add a new Stat button 'Attendance' and set icon as a last action of employee
- 'Manual Attendance' field should only be visible if 'Related User' field is set
- 'PIN' field should only be visible if in setting enabled
- 'Payslips' stat button not displayed if user has no access rights
- If no start/end dates selected then '-' will be removed on 'Trial Period Duration' field
- Rearrange fields on employee form's 'Contact Information'

[IMP] Various usability improvments on attendance and HR application
This commit is contained in:
hbh
2017-01-03 13:53:30 +01:00
committed by DVE
parent 8cfd857b82
commit 158f779b46
8 changed files with 46 additions and 13 deletions
+1 -1
View File
@@ -126,7 +126,7 @@ class Employee(models.Model):
('divorced', 'Divorced')
], string='Marital Status')
department_id = fields.Many2one('hr.department', string='Department')
address_id = fields.Many2one('res.partner', string='Working Address')
address_id = fields.Many2one('res.partner', string='Work Address')
address_home_id = fields.Many2one('res.partner', string='Home Address')
bank_account_id = fields.Many2one('res.partner.bank', string='Bank Account Number',
domain="[('partner_id', '=', address_home_id)]", help='Employee bank salary account')
+2 -2
View File
@@ -59,9 +59,9 @@
<field name="address_id"
context="{'show_address': 1}"
options='{"always_reload": True, "highlight_first_line": True}'/>
<field name="mobile_phone"/>
<field name="work_location"/>
<field name="work_email" widget="email"/>
<field name="mobile_phone"/>
<field name="work_phone"/>
</group>
<group string="Position">
@@ -98,7 +98,7 @@
</page>
<page string="HR Settings" groups="hr.group_hr_user">
<group>
<group string='Status' name="active_group">
<group string='Attendance' name="active_group">
<field name="company_id" groups="base.group_multi_company"/>
<field name="user_id" string="Related User"/>
</group>
@@ -4,7 +4,7 @@
id="hr_employee_print_badge"
string="Print Badge"
model="hr.employee"
report_type="qweb-html"
report_type="qweb-pdf"
name="hr_attendance.print_employee_badge"
file="hr_attendance.print_employee_badge"/>
<record id="hr_employee_print_badge" model="ir.actions.report.xml">
@@ -9,15 +9,15 @@
.oe_hr_attendance_status {
font-size: 1.2em;
margin-right: .3em;
margin-right: .1em;
display: inline-block;
color: @odoo-brand-secondary;
&.oe_hr_attendance_status_green {
color: @brand-success;
color: @brand-success !important;
}
&.oe_hr_attendance_status_red {
color: @brand-danger;
color: @brand-danger !important;
}
}
@@ -92,6 +92,17 @@
</field>
</record>
<record id="hr_attendance_action_employee" model="ir.actions.act_window">
<field name="name">Attendances</field>
<field name="res_model">hr.attendance</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_employee_id': active_id, 'default_employee_id': active_id}</field>
<field name="help" type="html">
<p>No attendance records to display.</p>
</field>
</record>
<record id="hr_attendance_action_graph" model="ir.actions.act_window">
<field name="name">Attendance Analysis</field>
<field name="res_model">hr.attendance</field>
@@ -9,18 +9,39 @@
<field name="arch" type="xml">
<field name="name" position="replace">
<div id="textbox">
<field name="attendance_state" widget="hr_attendance_form_presence_indicator"/>
<field name="name" placeholder="Employee's Name"/>
</div>
</field>
<field name="user_id" position="after">
<field name="barcode" groups="hr_attendance.group_hr_attendance_user"/>
<field name="pin" groups="hr_attendance.group_hr_attendance_user,hr_attendance.group_hr_attendance_use_pin"/>
<field name="manual_attendance" groups="hr_attendance.group_hr_attendance_user"/>
<field name="pin" groups="hr_attendance.group_hr_attendance_use_pin"/>
<field name="manual_attendance" groups="hr_attendance.group_hr_attendance_user" attrs="{'invisible': [('user_id', '=', False)]}"/>
</field>
</field>
</record>
<record id="view_employee_form_inherit_hr_attendance_stat" model="ir.ui.view">
<field name="name">hr.employee.inherit</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<data>
<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 class="fa fa-fw fa-user o_button_icon oe_hr_attendance_status oe_hr_attendance_status_green" attrs="{'invisible': [('attendance_state', '=', 'checked_out')]}"/>
<div class="fa fa-fw fa-user o_button_icon oe_hr_attendance_status 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>
</data>
</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>
@@ -108,11 +108,12 @@
<group name="duration_group" string="Duration">
<label for="trial_date_start" string="Trial Period Duration"/>
<div>
<field name="trial_date_start" class="oe_inline"/> - <field name="trial_date_end" class="oe_inline"/>
<field name="trial_date_start" class="oe_inline"/>
<span attrs="{'invisible': ['|', ('trial_date_start', '=', False), ('trial_date_end', '=', False)]}"> - </span><field name="trial_date_end" class="oe_inline"/>
</div>
<label for="date_start" string="Duration"/>
<div>
<field name="date_start" class="oe_inline"/> - <field name="date_end" class="oe_inline"/>
<field name="date_start" class="oe_inline"/><span attrs="{'invisible': ['|', ('date_start', '=', False), ('date_end', '=', False)]}"> - </span><field name="date_end" class="oe_inline"/>
</div>
<field name="working_hours"/>
</group>
+1 -1
View File
@@ -390,7 +390,7 @@
class="oe_stat_button"
icon="fa-money"
type="action"
groups="hr.group_hr_user">
groups="hr_payroll.group_hr_payroll_user">
<field name="payslip_count" widget="statinfo" string="Payslips"/>
</button>
</button>