Skip to content

Commit 6f79131

Browse files
authored
Merge pull request OCA#492 from brainbeanapps/12.0-add-hr_employee_health
[12.0][ADD] hr_employee_health: track specific needs of employees
2 parents 8b11657 + 26daa05 commit 6f79131

19 files changed

+783
-0
lines changed

hr_employee_health/README.rst

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
==================
2+
HR Employee Health
3+
==================
4+
5+
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6+
!! This file is generated by oca-gen-addon-readme !!
7+
!! changes will be overwritten. !!
8+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9+
10+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
11+
:target: https://odoo-community.org/page/development-status
12+
:alt: Beta
13+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
14+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
15+
:alt: License: AGPL-3
16+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr-lightgray.png?logo=github
17+
:target: https://github.com/OCA/hr/tree/12.0/hr_employee_health
18+
:alt: OCA/hr
19+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
20+
:target: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_employee_health
21+
:alt: Translate me on Weblate
22+
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23+
:target: https://runbot.odoo-community.org/runbot/116/12.0
24+
:alt: Try me on Runbot
25+
26+
|badge1| |badge2| |badge3| |badge4| |badge5|
27+
28+
This module allows storing information about employee's health.
29+
30+
**Table of contents**
31+
32+
.. contents::
33+
:local:
34+
35+
Bug Tracker
36+
===========
37+
38+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr/issues>`_.
39+
In case of trouble, please check there if your issue has already been reported.
40+
If you spotted it first, help us smashing it by providing a detailed and welcomed
41+
`feedback <https://github.com/OCA/hr/issues/new?body=module:%20hr_employee_health%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
42+
43+
Do not contact contributors directly about support or help with technical issues.
44+
45+
Credits
46+
=======
47+
48+
Authors
49+
~~~~~~~
50+
51+
* Brainbean Apps
52+
53+
Contributors
54+
~~~~~~~~~~~~
55+
56+
* Alexey Pelykh <[email protected]>
57+
58+
Maintainers
59+
~~~~~~~~~~~
60+
61+
This module is maintained by the OCA.
62+
63+
.. image:: https://odoo-community.org/logo.png
64+
:alt: Odoo Community Association
65+
:target: https://odoo-community.org
66+
67+
OCA, or the Odoo Community Association, is a nonprofit organization whose
68+
mission is to support the collaborative development of Odoo features and
69+
promote its widespread use.
70+
71+
This module is part of the `OCA/hr <https://github.com/OCA/hr/tree/12.0/hr_employee_health>`_ project on GitHub.
72+
73+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

hr_employee_health/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
2+
3+
from . import models

hr_employee_health/__manifest__.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright (C) 2018 Brainbean Apps (https://brainbeanapps.com)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
3+
4+
{
5+
'name': 'HR Employee Health',
6+
'version': '12.0.1.0.0',
7+
'category': 'Human Resources',
8+
'website': 'https://github.com/OCA/hr',
9+
'author':
10+
'Brainbean Apps, '
11+
'Odoo Community Association (OCA)',
12+
'license': 'AGPL-3',
13+
'installable': True,
14+
'application': False,
15+
'summary': 'Allows storing information about employee\'s health',
16+
'depends': [
17+
'hr',
18+
],
19+
'data': [
20+
'security/ir.model.access.csv',
21+
'data/data_health_condition_type.xml',
22+
'data/data_health_condition_severity.xml',
23+
'data/data_blood_type.xml',
24+
'views/hr_employee.xml',
25+
'views/hr_employee_health_condition.xml',
26+
],
27+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo noupdate="1">
3+
<!--
4+
Copyright (C) 2018 Brainbean Apps (https://brainbeanapps.com)
5+
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
6+
-->
7+
8+
<!-- hr.employee.blood.type -->
9+
<record model="hr.employee.blood.type" id="blood_type_a_rh_neg">
10+
<field name="name">A Rh-</field>
11+
</record>
12+
<record model="hr.employee.blood.type" id="blood_type_a_rh_pos">
13+
<field name="name">A Rh+</field>
14+
</record>
15+
<record model="hr.employee.blood.type" id="blood_type_b_rh_neg">
16+
<field name="name">B Rh-</field>
17+
</record>
18+
<record model="hr.employee.blood.type" id="blood_type_b_rh_pos">
19+
<field name="name">B Rh+</field>
20+
</record>
21+
<record model="hr.employee.blood.type" id="blood_type_ab_rh_neg">
22+
<field name="name">AB Rh-</field>
23+
</record>
24+
<record model="hr.employee.blood.type" id="blood_type_ab_rh_pos">
25+
<field name="name">AB Rh+</field>
26+
</record>
27+
<record model="hr.employee.blood.type" id="blood_type_o_rh_neg">
28+
<field name="name">O Rh-</field>
29+
</record>
30+
<record model="hr.employee.blood.type" id="blood_type_o_rh_pos">
31+
<field name="name">O Rh+</field>
32+
</record>
33+
34+
</odoo>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo noupdate="1">
3+
<!--
4+
Copyright (C) 2018 Brainbean Apps (https://brainbeanapps.com)
5+
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
6+
-->
7+
8+
<!-- hr.employee.health.condition.severity -->
9+
<record model="hr.employee.health.condition.severity" id="severity_life_threatening">
10+
<field name="name">Life-threatening</field>
11+
</record>
12+
<record model="hr.employee.health.condition.severity" id="severity_extreme">
13+
<field name="name">Extreme</field>
14+
</record>
15+
<record model="hr.employee.health.condition.severity" id="severity_major">
16+
<field name="name">Major</field>
17+
</record>
18+
<record model="hr.employee.health.condition.severity" id="severity_moderate">
19+
<field name="name">Moderate</field>
20+
</record>
21+
<record model="hr.employee.health.condition.severity" id="severity_minor">
22+
<field name="name">Minor</field>
23+
</record>
24+
25+
</odoo>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo noupdate="1">
3+
<!--
4+
Copyright (C) 2018 Brainbean Apps (https://brainbeanapps.com)
5+
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
6+
-->
7+
8+
<!-- hr.employee.health.condition.type -->
9+
<record model="hr.employee.health.condition.type" id="condition_food_allergy_milk">
10+
<field name="name">Food allergy: Milk</field>
11+
</record>
12+
<record model="hr.employee.health.condition.type" id="condition_food_allergy_eggs">
13+
<field name="name">Food allergy: Eggs</field>
14+
</record>
15+
<record model="hr.employee.health.condition.type" id="condition_food_allergy_fish">
16+
<field name="name">Food allergy: Fish</field>
17+
</record>
18+
<record model="hr.employee.health.condition.type" id="condition_food_allergy_crustacean_shellfish">
19+
<field name="name">Food allergy: Crustacean shellfish</field>
20+
</record>
21+
<record model="hr.employee.health.condition.type" id="condition_food_allergy_tree_nuts">
22+
<field name="name">Food allergy: Tree nuts</field>
23+
</record>
24+
<record model="hr.employee.health.condition.type" id="condition_food_allergy_peanuts">
25+
<field name="name">Food allergy: Peanuts</field>
26+
</record>
27+
<record model="hr.employee.health.condition.type" id="condition_food_allergy_wheat">
28+
<field name="name">Food allergy: Wheat</field>
29+
</record>
30+
<record model="hr.employee.health.condition.type" id="condition_food_allergy_soybeans">
31+
<field name="name">Food allergy: Soybeans</field>
32+
</record>
33+
<record model="hr.employee.health.condition.type" id="condition_mental_illness">
34+
<field name="name">Mental illnesss</field>
35+
</record>
36+
<record model="hr.employee.health.condition.type" id="condition_epilepsy">
37+
<field name="name">Epilepsy</field>
38+
</record>
39+
<record model="hr.employee.health.condition.type" id="condition_diabetes">
40+
<field name="name">Diabetes</field>
41+
</record>
42+
43+
</odoo>

hr_employee_health/models/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
2+
3+
from . import hr_employee
4+
from . import hr_employee_health_condition
5+
from . import hr_employee_health_condition_type
6+
from . import hr_employee_health_condition_severity
7+
from . import hr_employee_blood_type
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (C) 2018 Brainbean Apps (https://brainbeanapps.com)
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
6+
7+
class HrEmployee(models.Model):
8+
_inherit = 'hr.employee'
9+
10+
health_condition_ids = fields.One2many(
11+
string='Health Conditions',
12+
comodel_name='hr.employee.health.condition',
13+
inverse_name='employee_id',
14+
groups='hr.group_hr_user',
15+
)
16+
blood_type = fields.Many2one(
17+
string='Blood Type',
18+
comodel_name='hr.employee.blood.type',
19+
groups='hr.group_hr_user',
20+
)
21+
health_notes = fields.Text(
22+
string='Health Notes',
23+
groups='hr.group_hr_user',
24+
)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (C) 2018 Brainbean Apps (https://brainbeanapps.com)
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
6+
7+
class HrEmployeeBloodType(models.Model):
8+
_name = 'hr.employee.blood.type'
9+
_description = 'HR Employee Blood Type'
10+
11+
name = fields.Char(
12+
string='Type',
13+
required=True,
14+
translate=True
15+
)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (C) 2018 Brainbean Apps (https://brainbeanapps.com)
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
6+
7+
class HrEmployeeHealthCondition(models.Model):
8+
_name = 'hr.employee.health.condition'
9+
_description = 'HR Employee Health Condition'
10+
11+
employee_id = fields.Many2one(
12+
string='Employee',
13+
comodel_name='hr.employee',
14+
)
15+
type_id = fields.Many2one(
16+
'hr.employee.health.condition.type',
17+
string='Condition',
18+
required=True,
19+
)
20+
severity_id = fields.Many2one(
21+
'hr.employee.health.condition.severity',
22+
string='Severity',
23+
)
24+
notes = fields.Text(
25+
string='Notes',
26+
)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (C) 2018 Brainbean Apps (https://brainbeanapps.com)
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
6+
7+
class HrEmployeeHealthConditionSeverity(models.Model):
8+
_name = 'hr.employee.health.condition.severity'
9+
_description = 'HR Employee Health Condition Severity'
10+
11+
name = fields.Char(
12+
string='Severity',
13+
required=True,
14+
translate=True
15+
)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (C) 2018 Brainbean Apps (https://brainbeanapps.com)
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
6+
7+
class HrEmployeeHealthConditionType(models.Model):
8+
_name = 'hr.employee.health.condition.type'
9+
_description = 'HR Employee Health Condition Type'
10+
11+
name = fields.Char(
12+
string='Type',
13+
required=True,
14+
translate=True
15+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Alexey Pelykh <[email protected]>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This module allows storing information about employee's health.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2+
access_hr_employee_health_condition_employee,hr.employee.health.condition,model_hr_employee_health_condition,base.group_user,1,0,0,0
3+
access_hr_employee_health_condition_user,hr.employee.health.condition,model_hr_employee_health_condition,hr.group_hr_manager,1,1,1,1
4+
access_hr_employee_health_condition_type_employee,hr.employee.health.condition.type,model_hr_employee_health_condition_type,base.group_user,1,0,0,0
5+
access_hr_employee_health_condition_type_user,hr.employee.health.condition.type,model_hr_employee_health_condition_type,hr.group_hr_manager,1,1,1,1
6+
access_hr_employee_health_condition_severity_employee,hr.employee.health.condition.severity,model_hr_employee_health_condition_severity,base.group_user,1,0,0,0
7+
access_hr_employee_health_condition_severity_user,hr.employee.health.condition.severity,model_hr_employee_health_condition_severity,hr.group_hr_manager,1,1,1,1
8+
access_hr_employee_blood_type_employee,hr.employee.blood.type,model_hr_employee_blood_type,base.group_user,1,0,0,0
9+
access_hr_employee_blood_type_user,hr.employee.blood.type,model_hr_employee_blood_type,hr.group_hr_manager,1,1,1,1

0 commit comments

Comments
 (0)