diff --git a/hr_employee_updation/README.md b/hr_employee_updation/README.md new file mode 100644 index 000000000..3f124a582 --- /dev/null +++ b/hr_employee_updation/README.md @@ -0,0 +1,17 @@ +OHRMS Employee Info +------------------- +Supporting Addon for Open HRMS, Added Advance 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 diff --git a/hr_employee_updation/RELEASE_NOTES.md b/hr_employee_updation/RELEASE_NOTES.md new file mode 100644 index 000000000..dd7ed9c35 --- /dev/null +++ b/hr_employee_updation/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 30.03.2018 +#### Version 10.0.1.0.0 +##### ADD +- Initial commit for OpenHrms Project diff --git a/hr_employee_updation/__init__.py b/hr_employee_updation/__init__.py new file mode 100644 index 000000000..b579ce91c --- /dev/null +++ b/hr_employee_updation/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# 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 . +# +################################################################################### +from . import models + + diff --git a/hr_employee_updation/__manifest__.py b/hr_employee_updation/__manifest__.py new file mode 100644 index 000000000..5dae48fba --- /dev/null +++ b/hr_employee_updation/__manifest__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# 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 . +# +################################################################################### +{ + 'name': 'OHRMS Employee Info', + 'version': '10.0.1.0.0', + 'summary': """Adding Advance 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, +} diff --git a/hr_employee_updation/models/__init__.py b/hr_employee_updation/models/__init__.py new file mode 100644 index 000000000..01c1233ae --- /dev/null +++ b/hr_employee_updation/models/__init__.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# 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 . +# +################################################################################### +from . import hr_employee + + + + diff --git a/hr_employee_updation/models/hr_employee.py b/hr_employee_updation/models/hr_employee.py new file mode 100644 index 000000000..0ed69a441 --- /dev/null +++ b/hr_employee_updation/models/hr_employee.py @@ -0,0 +1,126 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Jesni Banu () +# +# 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 . +# +################################################################################### +from datetime import datetime, timedelta +from odoo import models, fields, _ + +GENDER_SELECTION = [('male', 'Male'), + ('female', 'Female'), + ('other', 'Other')] + + +class HrEmployeeContractName(models.Model): + _name = 'hr.emergency.contact' + _description = 'HR Emergency Contact' + + number = fields.Char(string='Number') + relation = fields.Char(string='Contact') + employee_obj = fields.Many2one('hr.employee', invisible=1) + + +class HrEmployeeDocumentName(models.Model): + _name = 'hr.document.document' + _description = 'HR Employee Documents' + + name = fields.Char(string='Name') + + +class HrEmployeeFamily(models.Model): + _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", comodel_name='hr.employee', invisible=1) + employee_ref = fields.Many2one(string="Is Employee", 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') + 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): + 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 + ",
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'].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 + ",
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'].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') + passport_expiry_date = fields.Date(string='Expiry Date') + 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') + + +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') + + diff --git a/hr_employee_updation/security/ir.model.access.csv b/hr_employee_updation/security/ir.model.access.csv new file mode 100644 index 000000000..c17dd7d95 --- /dev/null +++ b/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 \ No newline at end of file diff --git a/hr_employee_updation/static/description/HRMS-BUTTON.png b/hr_employee_updation/static/description/HRMS-BUTTON.png new file mode 100644 index 000000000..0f1b65bea Binary files /dev/null and b/hr_employee_updation/static/description/HRMS-BUTTON.png differ diff --git a/hr_employee_updation/static/description/banner.jpg b/hr_employee_updation/static/description/banner.jpg new file mode 100644 index 000000000..5c5c11882 Binary files /dev/null and b/hr_employee_updation/static/description/banner.jpg differ diff --git a/hr_employee_updation/static/description/cybro-service.png b/hr_employee_updation/static/description/cybro-service.png new file mode 100644 index 000000000..0a648278c Binary files /dev/null and b/hr_employee_updation/static/description/cybro-service.png differ diff --git a/hr_employee_updation/static/description/cybro_logo.png b/hr_employee_updation/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/hr_employee_updation/static/description/cybro_logo.png differ diff --git a/hr_employee_updation/static/description/icon.png b/hr_employee_updation/static/description/icon.png new file mode 100644 index 000000000..cc02f7a68 Binary files /dev/null and b/hr_employee_updation/static/description/icon.png differ diff --git a/hr_employee_updation/static/description/index.html b/hr_employee_updation/static/description/index.html new file mode 100644 index 000000000..c2187bf97 --- /dev/null +++ b/hr_employee_updation/static/description/index.html @@ -0,0 +1,84 @@ + +
+
+

OpenHRMS

+

Most advanced open source HR management software

+
+
+ +
+
+
+
+ + + + +
+
+
+
+ +
+
+

OH Employee Info

+

Added Advance Fields On Employee Master

+

Cybrosys Technologies

+
+
+

Features:

+
+ Added family information.
+ Added joining date and contact info.
+ Added passport and id expiry date and attachments.
+ Added expiry notification for passport and id documents.
+
+
+
+ +
+
+
+

Overview

+

+ 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. +

+
+
+
+ +
+
+

Our Odoo Services

+
+
+
+ + + +
+
+
+ +
+

Need Any Help?

+ +
+ + diff --git a/hr_employee_updation/views/hr_employee_view.xml b/hr_employee_updation/views/hr_employee_view.xml new file mode 100644 index 000000000..deb5d24ea --- /dev/null +++ b/hr_employee_updation/views/hr_employee_view.xml @@ -0,0 +1,96 @@ + + + + + + + hr.employee.form.view + hr.employee + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + +
+
+
+
+
+
+ + + hr.employee.view.form.inherit + hr.employee + + + + +
+ +
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/hr_employee_updation/views/hr_notification.xml b/hr_employee_updation/views/hr_notification.xml new file mode 100644 index 000000000..91ea067a6 --- /dev/null +++ b/hr_employee_updation/views/hr_notification.xml @@ -0,0 +1,15 @@ + + + + + HR Employee Data Expiration + 1 + days + -1 + + + + + + +