diff --git a/employee_documents_expiry/README.md b/employee_documents_expiry/README.md new file mode 100644 index 000000000..b99bec134 --- /dev/null +++ b/employee_documents_expiry/README.md @@ -0,0 +1,26 @@ +Employee Documents +------------------ +Supporting Addon for HR, 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 this module, You can drop an email directly to Cybrosys. + +Contacts +-------- + +info - info@cybrosys.com +Cybrosys Odoo - odoo@cybrosys.com +Niyas Raphy - niyas@cybrosys.in + + diff --git a/employee_documents_expiry/__init__.py b/employee_documents_expiry/__init__.py new file mode 100644 index 000000000..8b5ef333d --- /dev/null +++ b/employee_documents_expiry/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Niyas Raphy () +# +# 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/employee_documents_expiry/__manifest__.py b/employee_documents_expiry/__manifest__.py new file mode 100644 index 000000000..cfa4cb5da --- /dev/null +++ b/employee_documents_expiry/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Niyas Raphy () +# +# 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': 'Employee Documents', + 'version': '11.0.1.0.0', + 'summary': """Manages Employee Documents With Expiry Notifications.""", + 'description': """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.cybrosys.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/employee_documents_expiry/__manifest__.py~ b/employee_documents_expiry/__manifest__.py~ new file mode 100644 index 000000000..9aef8c8a3 --- /dev/null +++ b/employee_documents_expiry/__manifest__.py~ @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'Employee Documents', + 'version': '10.0.2.0', + 'summary': """Manages Employee Documents With Expiry Notifications.""", + 'description': """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.cybrosys.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/employee_documents_expiry/data/data.xml b/employee_documents_expiry/data/data.xml new file mode 100644 index 000000000..ef0581a14 --- /dev/null +++ b/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/employee_documents_expiry/models/__init__.py b/employee_documents_expiry/models/__init__.py new file mode 100644 index 000000000..2fd41e613 --- /dev/null +++ b/employee_documents_expiry/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Niyas Raphy () +# +# 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/employee_documents_expiry/models/employee_documents.py b/employee_documents_expiry/models/employee_documents.py new file mode 100644 index 000000000..b71934a37 --- /dev/null +++ b/employee_documents_expiry/models/employee_documents.py @@ -0,0 +1,103 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Niyas Raphy () +# +# 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: + 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'].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/employee_documents_expiry/models/employee_entry_exit_check_list.py b/employee_documents_expiry/models/employee_entry_exit_check_list.py new file mode 100644 index 000000000..194399d8f --- /dev/null +++ b/employee_documents_expiry/models/employee_entry_exit_check_list.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Niyas Raphy () +# +# 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' + _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='Document Name', copy=False, required=1) + document_type = fields.Selection([('entry', 'Entry Process'), + ('exit', 'Exit Process'), + ('other', 'Other')], string='Checklist Type', required=1) + + diff --git a/employee_documents_expiry/models/employee_entry_exit_check_list.py~ b/employee_documents_expiry/models/employee_entry_exit_check_list.py~ new file mode 100644 index 000000000..6fbd2c51d --- /dev/null +++ b/employee_documents_expiry/models/employee_entry_exit_check_list.py~ @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) 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='Document Name', copy=False, required=1) + document_type = fields.Selection([('entry', 'Entry Documents'), + ('exit', 'Exit Documents'), + ('other', 'Other')], string='Checklist Type', required=1) + diff --git a/employee_documents_expiry/security/ir.model.access.csv b/employee_documents_expiry/security/ir.model.access.csv new file mode 100644 index 000000000..940ef0524 --- /dev/null +++ b/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/employee_documents_expiry/static/description/banner.jpg b/employee_documents_expiry/static/description/banner.jpg new file mode 100644 index 000000000..931855443 Binary files /dev/null and b/employee_documents_expiry/static/description/banner.jpg differ diff --git a/employee_documents_expiry/static/description/cybro_logo.png b/employee_documents_expiry/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/employee_documents_expiry/static/description/cybro_logo.png differ diff --git a/employee_documents_expiry/static/description/document_form.png b/employee_documents_expiry/static/description/document_form.png new file mode 100644 index 000000000..5c570a339 Binary files /dev/null and b/employee_documents_expiry/static/description/document_form.png differ diff --git a/employee_documents_expiry/static/description/email.png b/employee_documents_expiry/static/description/email.png new file mode 100644 index 000000000..90b70be6c Binary files /dev/null and b/employee_documents_expiry/static/description/email.png differ diff --git a/employee_documents_expiry/static/description/employee_form.png b/employee_documents_expiry/static/description/employee_form.png new file mode 100644 index 000000000..c7ea0e59f Binary files /dev/null and b/employee_documents_expiry/static/description/employee_form.png differ diff --git a/employee_documents_expiry/static/description/icon.png b/employee_documents_expiry/static/description/icon.png new file mode 100644 index 000000000..9aa49d9c9 Binary files /dev/null and b/employee_documents_expiry/static/description/icon.png differ diff --git a/employee_documents_expiry/static/description/index.html b/employee_documents_expiry/static/description/index.html new file mode 100644 index 000000000..948cea538 --- /dev/null +++ b/employee_documents_expiry/static/description/index.html @@ -0,0 +1,102 @@ +
+
+

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

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

Need Any Help?

+ +
+ + + diff --git a/employee_documents_expiry/views/employee_check_list_view.xml b/employee_documents_expiry/views/employee_check_list_view.xml new file mode 100644 index 000000000..c698be1ac --- /dev/null +++ b/employee_documents_expiry/views/employee_check_list_view.xml @@ -0,0 +1,34 @@ + + + + + employee.checklist.form + employee.checklist + +
+ + + + + + +
+ + +
+
+
+
+ + + employee.checklist.tree + employee.checklist + + + + + + + + +
\ No newline at end of file diff --git a/employee_documents_expiry/views/employee_document_view.xml b/employee_documents_expiry/views/employee_document_view.xml new file mode 100644 index 000000000..5b0dc0cec --- /dev/null +++ b/employee_documents_expiry/views/employee_document_view.xml @@ -0,0 +1,67 @@ + + + + + HR Employee Data Expiration + + code + model.mail_reminder() + 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 diff --git a/hr_employee_updation/models/__pycache__/__init__.cpython-35.pyc b/hr_employee_updation/models/__pycache__/__init__.cpython-35.pyc deleted file mode 100644 index df69ff4f1..000000000 Binary files a/hr_employee_updation/models/__pycache__/__init__.cpython-35.pyc and /dev/null differ diff --git a/hr_employee_updation/models/__pycache__/hr_employee.cpython-35.pyc b/hr_employee_updation/models/__pycache__/hr_employee.cpython-35.pyc deleted file mode 100644 index 67917ef42..000000000 Binary files a/hr_employee_updation/models/__pycache__/hr_employee.cpython-35.pyc and /dev/null differ