Files
odoo_source/addons/hr/data/hr_data.xml
T
Lucas Lefèvre f6fdde96bd [IMP] hr_*: Improve employee presence state
Purpose
=======
There are currently multiple ways to determine if an employee is presence
or absent:
- login state (user status on chat)
- checkin/checkout from the Attendance app
- leave
- hr_presence (email, ip)
Those states are displayed in several different places and can be inconsitent.
e.g. Logged in -> green in the chat
Not checked in -> red on the employee kanban view.

The multiple ways to determine employee presence described above
should be aggregated together to have a better consistency.

Specification
=============
There are 3 presence states (previously defined in module `hr_presence`),
namely `present`, `absent`, `to_define`. They are now defined as soon as
`hr` module is installed.

The state computation can have several behaviors according to which apps
are installed:

1. `hr` is installed
Check employee presence based on login by default (only for employees with
a user).
Kanban state (private and public): should be green when logged in, red when logged out and
orange when the user is away.
Private employee form: Display a stat button "Connected" on the form view
when the user is logged in or "Last Activity xx/xx/xxx" otherwise.

2. `hr_attendance` is installed:
when the user is logged out, the state
is determined from the checked in/out state. But when the user is logged in,
consider the user as present (even if he checked out).
Kanban state: green for checked in, red for checked out
Private form view: attendance stat button.

3. `hr_holidays` is installed:
Has the highest priority if the employee is on leave.
Kanban state: red if employee is on leave.
Private form view: stat button "Absent Until xx/xx/xxxx" if employee
is on leave.

4. `hr_presence` is installed:
Two additionnal presence checking option: emails sent and IP address connected.
Once a user sent an email or the IP address was connected, he is considered
present for the entire day.

There should be at most one stat button on the employee form view, with the
relevent information.

Task id: 2024482

closes odoo/odoo#34933

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-17 09:11:18 +00:00

109 lines
5.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="dep_administration" model="hr.department">
<field name="name">Administration</field>
</record>
<record id="dep_sales" model="hr.department">
<field name="name">Sales</field>
</record>
<record id="employee_admin" model="hr.employee">
<field name="name" eval="obj(ref('base.partner_admin')).name" model="res.partner"/>
<field name="user_id" ref="base.user_admin"/>
<field name="address_id" ref="base.partner_admin"/>
<field name="address_home_id" ref="base.partner_admin"/>
<field name="image" eval="obj(ref('base.partner_admin')).image" model="res.partner"/>
</record>
<record id="onboarding_setup_it_materials" model="hr.plan.activity.type">
<field name="summary">Setup IT Materials</field>
<field name="responsible">manager</field>
</record>
<record id="onboarding_plan_training" model="hr.plan.activity.type">
<field name="summary">Plan Training</field>
<field name="responsible">manager</field>
</record>
<record id="onboarding_training" model="hr.plan.activity.type">
<field name="summary">Training</field>
<field name="responsible">employee</field>
</record>
<record id="offboarding_setup_compute_out_delais" model="hr.plan.activity.type">
<field name="summary">Compute Out Delais</field>
<field name="responsible">manager</field>
</record>
<record id="offboarding_take_back_hr_materials" model="hr.plan.activity.type">
<field name="summary">Take Back HR Materials</field>
<field name="responsible">manager</field>
</record>
<record id="onboarding_plan" model='hr.plan'>
<field name="name">Onboarding</field>
<field name="plan_activity_type_ids" eval="[(6, 0, [
ref('hr.onboarding_setup_it_materials'),
ref('hr.onboarding_plan_training'),
ref('hr.onboarding_training'),
])]"/>
</record>
<record id="offboarding_plan" model='hr.plan'>
<field name="name">Offboarding</field>
<field name="plan_activity_type_ids" eval="[(6, 0, [
ref('hr.offboarding_setup_compute_out_delais'),
ref('hr.offboarding_take_back_hr_materials'),
])]"/>
</record>
<record id="mail_template_data_unknown_employee_email_address" model="mail.template">
<field name="name">HR: mailgateway unknown employee bounce</field>
<field name="model_id" ref="base.model_ir_module_module"/>
<field name="subject">Your document has not been created</field>
<field name="email_from">${user.email_formatted | safe}</field>
<field name="email_to">${ctx['email_to']|safe}</field>
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
<tbody>
<tr>
<td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
<tr><td valign="top" style="font-size: 13px;">
<div>
Hi,<br/>
Your document has not been created because your email address is not recognized. Please send emails with the email address recorded on your employee information, or contact your HR manager.
</div>
</td></tr>
</table>
</td></tr>
</tbody>
</table>
</td></tr>
<!-- POWERED BY -->
<tr><td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;">
<tr><td style="text-align: center; font-size: 13px;">
Powered by <a target="_blank" href="https://www.odoo.com?utm_source=db&amp;utm_medium=hr" style="color: #875A7B;">Odoo</a>
</td></tr>
</table>
</td></tr>
</table>
</field>
<field name="lang">${user.lang}</field>
<field name="auto_delete" eval="True"/>
<field name="user_signature" eval="False"/>
</record>
<record model="ir.config_parameter" id="hr_presence_control_login" forcecreate="False">
<field name="key">hr.hr_presence_control_login</field>
<field name="value">True</field>
</record>
</data>
</odoo>