diff --git a/oh_employee_documents_expiry/README.md b/oh_employee_documents_expiry/README.md new file mode 100644 index 000000000..ee8775b0a --- /dev/null +++ b/oh_employee_documents_expiry/README.md @@ -0,0 +1,26 @@ +OH Employee Documents +--------------------- +Supporting Addon for Open HRMS, Manages Employee Related Documents + +Overview +-------- +Each and every detail associated with an employee is useful for any organization for better Human resource management. +So the employee documents with such necessary information must be saved and used accordingly. +'Employee Documents' is a useful tool that can help you to store and manage the employee related +documents like certificates, appraisal reports, passport, license etc. +The application also allows you to set an alert message on reaching the expiration/any other +related dates of a document (like an expiration of passport) + +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 +Nilmar Shereef - shereef@cybrosys.in + +Website: +https://www.openhrms.com +https://www.cybrosys.com diff --git a/oh_employee_documents_expiry/__init__.py b/oh_employee_documents_expiry/__init__.py new file mode 100644 index 000000000..16dcf27c6 --- /dev/null +++ b/oh_employee_documents_expiry/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Nilmar Shereef () +# +# 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/oh_employee_documents_expiry/__manifest__.py b/oh_employee_documents_expiry/__manifest__.py new file mode 100644 index 000000000..48c6dbfa2 --- /dev/null +++ b/oh_employee_documents_expiry/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Nilmar Shereef () +# +# 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 Documents', + 'version': '10.0.1.0', + 'summary': """Manages Employee Documents With Expiry Notifications.""", + 'description': """OH Addon: Manages Employee Related Documents with Expiry Notifications.""", + 'category': 'Generic Modules/Human Resources', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.openhrms.com", + 'depends': ['base', 'hr'], + 'data': [ + 'security/ir.model.access.csv', + 'views/employee_check_list_view.xml', + 'views/employee_document_view.xml', + ], + 'demo': ['data/data.xml'], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/oh_employee_documents_expiry/data/data.xml b/oh_employee_documents_expiry/data/data.xml new file mode 100644 index 000000000..ef0581a14 --- /dev/null +++ b/oh_employee_documents_expiry/data/data.xml @@ -0,0 +1,23 @@ + + + + Education Certificate + entry + + + Salary Certificate + entry + + + Experience Certificate + entry + + + Experience Certificate + exit + + + Salary Certificate + exit + + \ No newline at end of file diff --git a/oh_employee_documents_expiry/docs/RELEASE_NOTES.md b/oh_employee_documents_expiry/docs/RELEASE_NOTES.md new file mode 100644 index 000000000..8f06bb30d --- /dev/null +++ b/oh_employee_documents_expiry/docs/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module 'oh_employee_documents_expiry' + +#### 30.03.2018 +#### Version 10.0.1.0.0 +##### ADD +- Initial commit for OpenHrms Project diff --git a/oh_employee_documents_expiry/models/__init__.py b/oh_employee_documents_expiry/models/__init__.py new file mode 100644 index 000000000..6030a78af --- /dev/null +++ b/oh_employee_documents_expiry/models/__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: Nilmar Shereef () +# +# 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 employee_documents +from . import employee_entry_exit_check_list + diff --git a/oh_employee_documents_expiry/models/employee_documents.py b/oh_employee_documents_expiry/models/employee_documents.py new file mode 100644 index 000000000..ca31dca27 --- /dev/null +++ b/oh_employee_documents_expiry/models/employee_documents.py @@ -0,0 +1,104 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Nilmar Shereef () +# +# 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, date, timedelta +from odoo import models, fields, api, _ +from odoo.exceptions import Warning + + +class HrEmployeeDocument(models.Model): + _name = 'hr.employee.document' + _description = 'HR Employee Documents' + + def mail_reminder(self): + now = datetime.now() + timedelta(days=1) + date_now = now.date() + match = self.search([]) + for i in match: + if i.expiry_date: + exp_date = fields.Date.from_string(i.expiry_date) - timedelta(days=7) + if date_now >= exp_date: + mail_content = " Hello " + i.employee_ref.name + ",
Your Document " + i.name + "is going to expire on " + \ + str(i.expiry_date) + ". Please renew it before expiry date" + main_content = { + 'subject': _('Document-%s Expired On %s') % (i.name, i.expiry_date), + 'author_id': self.env.user.partner_id.id, + 'body_html': mail_content, + 'email_to': i.employee_ref.work_email, + } + self.env['mail.mail'].create(main_content).send() + + @api.constrains('expiry_date') + def check_expr_date(self): + for each in self: + if each.expiry_date: + exp_date = fields.Date.from_string(each.expiry_date) + if exp_date < date.today(): + raise Warning('Your Document Is Expired.') + + name = fields.Char(string='Document Number', required=True, copy=False) + document_name = fields.Many2one('employee.checklist', string='Document', required=True) + description = fields.Text(string='Description', copy=False) + expiry_date = fields.Date(string='Expiry Date', copy=False) + employee_ref = fields.Many2one('hr.employee', invisible=1, copy=False) + doc_attachment_id = fields.Many2many('ir.attachment', 'doc_attach_rel', 'doc_id', 'attach_id3', string="Attachment", + help='You can attach the copy of your document', copy=False) + issue_date = fields.Date(string='Issue Date', default=fields.datetime.now(), copy=False) + + +class HrEmployee(models.Model): + _inherit = 'hr.employee' + + @api.multi + def _document_count(self): + for each in self: + document_ids = self.env['hr.employee.document'].sudo().search([('employee_ref', '=', each.id)]) + each.document_count = len(document_ids) + + @api.multi + def document_view(self): + self.ensure_one() + domain = [ + ('employee_ref', '=', self.id)] + return { + 'name': _('Documents'), + 'domain': domain, + 'res_model': 'hr.employee.document', + 'type': 'ir.actions.act_window', + 'view_id': False, + 'view_mode': 'tree,form', + 'view_type': 'form', + 'help': _('''

+ Click to Create for New Documents +

'''), + 'limit': 80, + 'context': "{'default_employee_ref': '%s'}" % self.id + } + + document_count = fields.Integer(compute='_document_count', string='# Documents') + + +class HrEmployeeAttachment(models.Model): + _inherit = 'ir.attachment' + + doc_attach_rel = fields.Many2many('hr.employee.document', 'doc_attachment_id', 'attach_id3', 'doc_id', + string="Attachment", invisible=1) diff --git a/oh_employee_documents_expiry/models/employee_entry_exit_check_list.py b/oh_employee_documents_expiry/models/employee_entry_exit_check_list.py new file mode 100644 index 000000000..691916db2 --- /dev/null +++ b/oh_employee_documents_expiry/models/employee_entry_exit_check_list.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHRMS Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Nilmar Shereef () +# +# 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 odoo import models, fields, api + + +class EmployeeEntryDocuments(models.Model): + _name = 'employee.checklist' + _inherit = ['mail.thread', 'ir.needaction_mixin'] + _description = "Employee Documents" + + @api.multi + def name_get(self): + result = [] + for each in self: + if each.document_type == 'entry': + name = each.name + '_en' + elif each.document_type == 'exit': + name = each.name + '_ex' + elif each.document_type == 'other': + name = each.name + '_ot' + result.append((each.id, name)) + return result + + name = fields.Char(string='Name', copy=False, required=1) + document_type = fields.Selection([('entry', 'Entry Process'), + ('exit', 'Exit Process'), + ('other', 'Other')], string='Checklist Type', readonly=1, required=1) + + diff --git a/oh_employee_documents_expiry/security/ir.model.access.csv b/oh_employee_documents_expiry/security/ir.model.access.csv new file mode 100644 index 000000000..145868907 --- /dev/null +++ b/oh_employee_documents_expiry/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_checklist_user,employee.checklist.user,model_employee_checklist,hr.group_hr_user,1,1,1,1 +access_hr_employee_checklist_emp,employee.checklist.emp,model_employee_checklist,base.group_user,1,0,0,0 +"access_hr_employee_document_employee","hr.employee.document_employee","model_hr_employee_document","base.group_user",1,0,0,0 +"access_hr_employee_document_manager","hr.employee.document_manager","model_hr_employee_document","hr.group_hr_manager",1,1,1,1 +"access_hr_employee_document_user","hr.employee.document_user","model_hr_employee_document","hr.group_hr_user",1,1,1,0 + diff --git a/oh_employee_documents_expiry/static/description/HRMS-BUTTON.png b/oh_employee_documents_expiry/static/description/HRMS-BUTTON.png new file mode 100644 index 000000000..0f1b65bea Binary files /dev/null and b/oh_employee_documents_expiry/static/description/HRMS-BUTTON.png differ diff --git a/oh_employee_documents_expiry/static/description/banner.jpg b/oh_employee_documents_expiry/static/description/banner.jpg new file mode 100644 index 000000000..02c616c31 Binary files /dev/null and b/oh_employee_documents_expiry/static/description/banner.jpg differ diff --git a/oh_employee_documents_expiry/static/description/cybro-service.png b/oh_employee_documents_expiry/static/description/cybro-service.png new file mode 100644 index 000000000..252929a86 Binary files /dev/null and b/oh_employee_documents_expiry/static/description/cybro-service.png differ diff --git a/oh_employee_documents_expiry/static/description/cybro_logo.png b/oh_employee_documents_expiry/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/oh_employee_documents_expiry/static/description/cybro_logo.png differ diff --git a/oh_employee_documents_expiry/static/description/document_form.png b/oh_employee_documents_expiry/static/description/document_form.png new file mode 100644 index 000000000..5c570a339 Binary files /dev/null and b/oh_employee_documents_expiry/static/description/document_form.png differ diff --git a/oh_employee_documents_expiry/static/description/email.png b/oh_employee_documents_expiry/static/description/email.png new file mode 100644 index 000000000..90b70be6c Binary files /dev/null and b/oh_employee_documents_expiry/static/description/email.png differ diff --git a/oh_employee_documents_expiry/static/description/icon.png b/oh_employee_documents_expiry/static/description/icon.png new file mode 100644 index 000000000..0bfe48f4d Binary files /dev/null and b/oh_employee_documents_expiry/static/description/icon.png differ diff --git a/oh_employee_documents_expiry/static/description/index.html b/oh_employee_documents_expiry/static/description/index.html new file mode 100644 index 000000000..1791ad67c --- /dev/null +++ b/oh_employee_documents_expiry/static/description/index.html @@ -0,0 +1,127 @@ +
+
+

OpenHRMS

+

Most advanced open source HR management software

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

OHRMS Employee Documents

+

Manages Employee Related Documents

+

Cybrosys Technologies

+
+
+

Features:

+
+ Managing Documents of Employees.
+ Documents Types.
+ Expiry Date for Documents.
+ Validation for Expiry Date.
+ Mail Notification Based on Expiry Date.
+
+
+
+ +
+
+
+

Overview

+

+Each and every detail associated with an employee is useful for any organization for better Human resource management. + So the employee documents with such necessary information must be saved and used accordingly. + 'Employee Documents' is a useful tool that can help you to store and manage the employee related + documents like certificates, appraisal reports, passport, license etc. +The application also allows you to set an alert message on reaching the expiration/any other + related dates of a document (like an expiration of passport) +

+
+
+
+ +
+
+
+

+

Documents Super Button

+

+

+
+
+ +
+
+
+
+ +
+
+

Documents Form

+
+
+ +
+
+
+
+ +
+
+

Notification Mail for Expiry Doc

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

Our Odoo Services

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

Need Any Help?

+ +
+ + + diff --git a/oh_employee_documents_expiry/static/description/oh_document_form.png b/oh_employee_documents_expiry/static/description/oh_document_form.png new file mode 100644 index 000000000..594c65059 Binary files /dev/null and b/oh_employee_documents_expiry/static/description/oh_document_form.png differ diff --git a/oh_employee_documents_expiry/static/description/oh_employee_fom.png b/oh_employee_documents_expiry/static/description/oh_employee_fom.png new file mode 100644 index 000000000..53e0af5aa Binary files /dev/null and b/oh_employee_documents_expiry/static/description/oh_employee_fom.png differ diff --git a/oh_employee_documents_expiry/views/employee_check_list_view.xml b/oh_employee_documents_expiry/views/employee_check_list_view.xml new file mode 100644 index 000000000..eb702bb92 --- /dev/null +++ b/oh_employee_documents_expiry/views/employee_check_list_view.xml @@ -0,0 +1,32 @@ + + + + employee.checklist.form + employee.checklist + +
+ + + + + + +
+ + +
+
+
+
+ + + employee.checklist.tree + employee.checklist + + + + + + + +
\ No newline at end of file diff --git a/oh_employee_documents_expiry/views/employee_document_view.xml b/oh_employee_documents_expiry/views/employee_document_view.xml new file mode 100644 index 000000000..7695a396d --- /dev/null +++ b/oh_employee_documents_expiry/views/employee_document_view.xml @@ -0,0 +1,66 @@ + + + + HR Employee Data Expiration + 1 + days + -1 + + + + + + + + hr.employee.document.form + hr.employee.document + +
+ + + + + + + + + + + + + + + + + + + +
+
+
+ + + hr.employee.document.tree + hr.employee.document + + + + + + + + + + + hr.employee.form.view + hr.employee + + +
+ +
+
+
+
\ No newline at end of file