Browse Source

[ADD] Initial Commit

pull/72/head
Sreejith P 7 years ago
parent
commit
07965acf06
  1. 17
      hr_employee_updation/README.md
  2. 25
      hr_employee_updation/__init__.py
  3. 44
      hr_employee_updation/__manifest__.py
  4. 6
      hr_employee_updation/doc/RELEASE_NOTES.md
  5. 27
      hr_employee_updation/models/__init__.py
  6. BIN
      hr_employee_updation/models/__pycache__/__init__.cpython-35.pyc
  7. BIN
      hr_employee_updation/models/__pycache__/hr_employee.cpython-35.pyc
  8. 128
      hr_employee_updation/models/hr_employee.py
  9. 7
      hr_employee_updation/security/ir.model.access.csv
  10. BIN
      hr_employee_updation/static/description/HRMS-BUTTON.png
  11. BIN
      hr_employee_updation/static/description/banner.jpg
  12. BIN
      hr_employee_updation/static/description/cybro-service.png
  13. BIN
      hr_employee_updation/static/description/cybro_logo.png
  14. BIN
      hr_employee_updation/static/description/emergency_contact.png
  15. BIN
      hr_employee_updation/static/description/family_info.png
  16. BIN
      hr_employee_updation/static/description/icon.png
  17. 135
      hr_employee_updation/static/description/index.html
  18. BIN
      hr_employee_updation/static/description/joining_date.png
  19. BIN
      hr_employee_updation/static/description/personal_info.png
  20. 103
      hr_employee_updation/views/hr_employee_view.xml
  21. 15
      hr_employee_updation/views/hr_notification.xml

17
hr_employee_updation/README.md

@ -0,0 +1,17 @@
Open HRMS Employee Info
-----------------------
Supporting Addon for Open HRMS, Added Advanced Fields On Employee Master.
Connect with experts
--------------------
If you have any question/queries/additional works on OpenHRMS or this module, You can drop an email directly to Cybrosys.
Contacts
--------
info - info@cybrosys.com
Jesni Banu - jesni@cybrosys.in
Website:
https://www.openhrms.com
https://www.cybrosys.com

25
hr_employee_updation/__init__.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of Open HRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Jesni Banu (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import models

44
hr_employee_updation/__manifest__.py

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of Open HRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Jesni Banu (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
{
'name': 'Open HRMS Employee Info',
'version': '11.0.1.0.0',
'summary': """Adding Advanced Fields In Employee Master""",
'description': 'This module helps you to add more information in employee records.',
'category': 'Generic Modules/Human Resources',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': "https://www.openhrms.com",
'depends': ['base', 'hr', 'mail', 'hr_gamification'],
'data': [
'security/ir.model.access.csv',
'views/hr_employee_view.xml',
'views/hr_notification.xml',
],
'demo': [],
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

6
hr_employee_updation/doc/RELEASE_NOTES.md

@ -0,0 +1,6 @@
## Module <hr_employee_updation>
#### 10.04.2018
#### Version 11.0.1.0.0
##### ADD
- Initial commit for Open HRMS Project

27
hr_employee_updation/models/__init__.py

@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of Open HRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Jesni Banu (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import hr_employee

BIN
hr_employee_updation/models/__pycache__/__init__.cpython-35.pyc

Binary file not shown.

BIN
hr_employee_updation/models/__pycache__/hr_employee.cpython-35.pyc

Binary file not shown.

128
hr_employee_updation/models/hr_employee.py

@ -0,0 +1,128 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of Open HRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Jesni Banu (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from datetime import datetime, timedelta
from odoo import models, fields, _
GENDER_SELECTION = [('male', 'Male'),
('female', 'Female'),
('other', 'Other')]
class HrEmployeeContractName(models.Model):
"""This class is to add emergency contact table"""
_name = 'hr.emergency.contact'
_description = 'HR Emergency Contact'
number = fields.Char(string='Number', help='Contact Number')
relation = fields.Char(string='Contact', help='Relation with employee')
employee_obj = fields.Many2one('hr.employee', invisible=1)
class HrEmployeeFamily(models.Model):
"""Table for keep employee family information"""
_name = 'hr.employee.family'
_description = 'HR Employee Family'
member_name = fields.Char(string='Name', related='employee_ref.name', store=True)
employee_id = fields.Many2one(string="Employee", help='Select corresponding Employee', comodel_name='hr.employee',
invisible=1)
employee_ref = fields.Many2one(string="Is Employee", help='If family member currently is an employee of '
'same company, then please tick this field',
comodel_name='hr.employee')
member_id = fields.Char(string='Identification No', related='employee_ref.identification_id', store=True)
member_passport = fields.Char(string='Passport No', related='employee_ref.passport_id', store=True)
member_passport_expiry_date = fields.Date(string='Expiry Date', related='employee_ref.passport_expiry_date',
store=True)
relation = fields.Selection([('father', 'Father'),
('mother', 'Mother'),
('daughter', 'Daughter'),
('son', 'Son'),
('wife', 'Wife')], string='Relationship', help='Relation with employee')
member_contact = fields.Char(string='Contact No', related='employee_ref.personal_mobile', store=True)
date_of_birth = fields.Date(string="Date of Birth", related='employee_ref.birthday', store=True)
gender = fields.Selection(string='Gender', selection=GENDER_SELECTION, related='employee_ref.gender', store=True)
class HrEmployee(models.Model):
_inherit = 'hr.employee'
def mail_reminder(self):
"""Sending expiry date notification for ID and Passport"""
now = datetime.now() + timedelta(days=1)
date_now = now.date()
match = self.search([])
for i in match:
if i.id_expiry_date:
exp_date = fields.Date.from_string(i.id_expiry_date) - timedelta(days=14)
if date_now >= exp_date:
mail_content = " Hello " + i.name + ",<br>Your ID " + i.identification_id + "is going to expire on " + \
str(i.id_expiry_date) + ". Please renew it before expiry date"
main_content = {
'subject': _('ID-%s Expired On %s') % (i.identification_id, i.id_expiry_date),
'author_id': self.env.user.partner_id.id,
'body_html': mail_content,
'email_to': i.work_email,
}
self.env['mail.mail'].sudo().create(main_content).send()
match1 = self.search([])
for i in match1:
if i.passport_expiry_date:
exp_date1 = fields.Date.from_string(i.passport_expiry_date) - timedelta(days=180)
if date_now >= exp_date1:
mail_content = " Hello " + i.name + ",<br>Your Passport " + i.passport_id + "is going to expire on " + \
str(i.passport_expiry_date) + ". Please renew it before expiry date"
main_content = {
'subject': _('Passport-%s Expired On %s') % (i.passport_id, i.passport_expiry_date),
'author_id': self.env.user.partner_id.id,
'body_html': mail_content,
'email_to': i.work_email,
}
self.env['mail.mail'].sudo().create(main_content).send()
personal_mobile = fields.Char(string='Mobile', related='address_home_id.mobile', store=True)
emergency_contact = fields.One2many('hr.emergency.contact', 'employee_obj', string='Emergency Contact')
joining_date = fields.Date(string='Joining Date')
id_expiry_date = fields.Date(string='Expiry Date', help='Expiry date of Identification ID')
passport_expiry_date = fields.Date(string='Expiry Date', help='Expiry date of Passport ID')
id_attachment_id = fields.Many2many('ir.attachment', 'id_attachment_rel', 'id_ref', 'attach_ref',
string="Attachment", help='You can attach the copy of your Id')
passport_attachment_id = fields.Many2many('ir.attachment', 'passport_attachment_rel', 'passport_ref', 'attach_ref1',
string="Attachment",
help='You can attach the copy of Passport')
fam_ids = fields.One2many('hr.employee.family', 'employee_id', string='Family', help='Family Information')
class HrEmployeeAttachment(models.Model):
_inherit = 'ir.attachment'
id_attachment_rel = fields.Many2many('hr.employee', 'id_attachment_id', 'attach_ref', 'id_ref', string="Attachment",
invisible=1)
passport_attachment_rel = fields.Many2many('hr.employee', 'passport_attachment_id', 'attach_ref1', 'passport_ref',
string="Attachment", invisible=1)
training_attach_rel = fields.Many2many('ir.attachment', 'certificate_id', 'training_attach_id3', 'training_id',
string="Certificates", invisible=1,
help='You can attach the copy of your certificate')

7
hr_employee_updation/security/ir.model.access.csv

@ -0,0 +1,7 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_employee_family_employee","hr.employee.family_employee","model_hr_employee_family","base.group_user",1,0,0,0
"access_hr_employee_family_manager","hr.employee.family_manager","model_hr_employee_family","hr.group_hr_manager",1,1,1,1
"access_hr_employee_family_user","hr.employee.family_user","model_hr_employee_family","hr.group_hr_user",1,1,1,1
"access_hr_employee_emergency_contact","hr.emergency.contact","model_hr_emergency_contact","base.group_user",1,0,0,0
"access_hr_employee_emergency_contact_manager","hr.emergency.contact","model_hr_emergency_contact","hr.group_hr_manager",1,1,1,1
"access_hr_employee_emergency_contact_user","hr.emergency.contact","model_hr_emergency_contact","hr.group_hr_user",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_employee_family_employee hr.employee.family_employee model_hr_employee_family base.group_user 1 0 0 0
3 access_hr_employee_family_manager hr.employee.family_manager model_hr_employee_family hr.group_hr_manager 1 1 1 1
4 access_hr_employee_family_user hr.employee.family_user model_hr_employee_family hr.group_hr_user 1 1 1 1
5 access_hr_employee_emergency_contact hr.emergency.contact model_hr_emergency_contact base.group_user 1 0 0 0
6 access_hr_employee_emergency_contact_manager hr.emergency.contact model_hr_emergency_contact hr.group_hr_manager 1 1 1 1
7 access_hr_employee_emergency_contact_user hr.emergency.contact model_hr_emergency_contact hr.group_hr_user 1 1 1 1

BIN
hr_employee_updation/static/description/HRMS-BUTTON.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
hr_employee_updation/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

BIN
hr_employee_updation/static/description/cybro-service.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

BIN
hr_employee_updation/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
hr_employee_updation/static/description/emergency_contact.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
hr_employee_updation/static/description/family_info.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
hr_employee_updation/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

135
hr_employee_updation/static/description/index.html

@ -0,0 +1,135 @@
<section class="oe_container">
<div class="oe_row">
<h2 class="oe_slogan"><a href="https://www.openhrms.com">Open HRMS</a></h2>
<h3 class="oe_slogan">Most advanced open source HR management software</h3>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced oe_mt32">
<div class="oe_span">
<div class="oe_demo oe_picture oe_screenshot">
<a href="https://www.openhrms.com/#request-demo">
<img src="HRMS-BUTTON.png">
</a>
<div class="oe_demo_footer oe_centeralign">Online Demo</div>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Open HRMS Employee Info</h2>
<h3 class="oe_slogan">Added Advance Fields On Employee Master</h3>
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4>
</div>
<div class="oe_row oe_spaced" style="padding-left:65px;">
<h4>Features:</h4>
<div>
<span style="color:green;"> &#9745; </span> Added family information.<br/>
<span style="color:green;"> &#9745; </span> Added joining date and contact info.<br/>
<span style="color:green;"> &#9745; </span> Added passport and id expiry date and attachments.<br/>
<span style="color:green;"> &#9745; </span> Added expiry notification for passport and id documents.<br/>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_picture">
<h3 class="oe_slogan">Overview</h3>
<p class="oe_mt32 text-justify" style="text-align: center;">
This module added some advanced features on Employee master.
Such as family info, joining date, passport and Id expiry date.
This module also sends expiry notification for passport and id to corresponding employees.
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Identification ID & Passport ID</h4>
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="personal_info.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Emergency Contact Number</h4>
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="emergency_contact.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Family Information</h4>
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="family_info.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Joining Date</h4>
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="joining_date.png">
</div>
</div>
</div>
</section>
<div class="row section-content">
<div class="col-md-6 img-content">
<h3>Our Odoo Services</h3>
</div>
<div class="bc-span col-md-12">
<div class="inner-span">
<a target="_blank" href="https://www.openhrms.com">
<img class="img-border img-responsive thumbnail" src="cybro-service.png">
</a>
</div>
</div>
</div>
<section class="oe_container">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<div>
<a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/contact/" target="_blank"><i
class="fa fa-phone"></i> Contact Us </a>
<a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.odoo.com/apps/modules/browse?search=open+hrms" target="_blank"><i
class="fa fa-suitcase"></i> Other Open HRMS Addons </a>
<a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/odoo-customization-and-installation/" target="_blank"><i
class="fa fa-wrench"></i> Request Customization </a>
</div>
<br>
<a href="https://www.cybrosys.com/" target="_blank">
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
</a>
</div>
</section>

BIN
hr_employee_updation/static/description/joining_date.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
hr_employee_updation/static/description/personal_info.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

103
hr_employee_updation/views/hr_employee_view.xml

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<menuitem id="employee_report_menu" name="Reports" parent="hr.menu_hr_root" sequence="30"
groups="hr.group_hr_manager,hr.group_hr_user"/>
<menuitem id="menu_hr_management" name="HR Management" parent="hr.menu_hr_root" sequence="5"
groups="hr.group_hr_manager,hr.group_hr_user"/>
<record model="ir.ui.view" id="hr_employee_inherit_form_view">
<field name="name">hr.employee.form.view</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='personal_information']/group" position="inside">
<group name="emergency_contact" colspan="4" string="Emergency Contact">
<field name="emergency_contact">
<tree editable="bottom">
<field name="number"/>
<field name="relation"/>
</tree>
</field>
</group>
</xpath>
<field name="address_home_id" position="after">
<field name="personal_mobile"/>
</field>
<field name="user_id" position="after">
<field name="joining_date"/>
</field>
<field name="identification_id" position="replace"/>
<field name="passport_id" position="replace"/>
<xpath expr="//page[@name='personal_information']/group/group[1]" position="after">
<group name="identification_id" string="Identification ID">
<field name="identification_id"/>
<field name="id_expiry_date" groups="hr.group_hr_user" attrs="{'invisible': [('identification_id', 'in', [None,False])]}"/>
<field name="id_attachment_id" groups="hr.group_hr_user" widget="many2many_binary" class="oe_inline" attrs="{'invisible': [('identification_id', 'in', [None,False])]}"/>
</group>
<group name="passport_id" string="Passport ID">
<field name="passport_id"/>
<field name="passport_expiry_date" groups="hr.group_hr_user" attrs="{'invisible': [('passport_id', 'in', [None,False])]}"/>
<field name="passport_attachment_id" groups="hr.group_hr_user" widget="many2many_binary" class="oe_inline" attrs="{'invisible': [('passport_id', 'in', [None,False])]}"/>
</group>
</xpath>
<page name="hr_settings" position="after">
<page name="family_info" string="Family Information" groups="hr.group_hr_user">
<group string="Family">
<field name="fam_ids" nolabel="1">
<form>
<group>
<group name="general_info">
<field name="employee_id" invisible="1"/>
<field name="employee_ref"/>
<field name="member_name"/>
<field name="date_of_birth"/>
<field name="member_id"/>
<field name="member_passport"/>
<field name="member_passport_expiry_date"
attrs="{'invisible': [('member_passport', 'in', [None,False])]}"/>
</group>
<group name="contact_info">
<field name="gender"/>
<field name="relation"/>
<field name="member_contact"/>
</group>
</group>
</form>
<tree>
<field name="member_name"/>
<field name="relation"/>
<field name="member_contact"/>
</tree>
</field>
</group>
</page>
</page>
</field>
</record>
<record id="hr_gamification.hr_hr_employee_view_form" model="ir.ui.view">
<field name="name">hr.employee.view.form.inherit</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='public']" position="after">
<page string="Received Badges" attrs="{'invisible': [('user_id', '=', False)]}">
<div name="badges" groups="hr.group_hr_user">
<field name="has_badges" invisible="1"/>
<button string="Grant a Badge" type="action" name="%(hr_gamification.action_reward_wizard)d"/> to reward this employee for a good action
<div class="oe_view_nocontent" attrs="{'invisible': [('has_badges', '=', True)]}">
<p class="oe_view_nocontent_create">
Click to grant this employee his first badge
</p><p class="oe_grey">
Badges are rewards of good work. Give them to people you believe deserve it.
</p>
</div>
</div>
<field name="badge_ids" widget="many2many_kanban" />
</page>
</xpath>
</field>
</record>
</data>
</odoo>

15
hr_employee_updation/views/hr_notification.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<record model="ir.cron" id="employee_data_reminder">
<field name="name">HR Employee Data Expiration</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False"/>
<field name="model_id" ref="model_hr_employee"/>
<field name="state">code</field>
<field name="code">model.mail_reminder()</field>
</record>
</data>
</odoo>
Loading…
Cancel
Save