Browse Source

[ADD] Initial Commit

pull/78/head
Sreejith 7 years ago
parent
commit
94be741885
  1. 26
      oh_employee_documents_expiry/README.md
  2. 24
      oh_employee_documents_expiry/__init__.py
  3. 45
      oh_employee_documents_expiry/__manifest__.py
  4. 23
      oh_employee_documents_expiry/data/data.xml
  5. 6
      oh_employee_documents_expiry/docs/RELEASE_NOTES.md
  6. 25
      oh_employee_documents_expiry/models/__init__.py
  7. 104
      oh_employee_documents_expiry/models/employee_documents.py
  8. 49
      oh_employee_documents_expiry/models/employee_entry_exit_check_list.py
  9. 7
      oh_employee_documents_expiry/security/ir.model.access.csv
  10. BIN
      oh_employee_documents_expiry/static/description/HRMS-BUTTON.png
  11. BIN
      oh_employee_documents_expiry/static/description/banner.jpg
  12. BIN
      oh_employee_documents_expiry/static/description/cybro-service.png
  13. BIN
      oh_employee_documents_expiry/static/description/cybro_logo.png
  14. BIN
      oh_employee_documents_expiry/static/description/document_form.png
  15. BIN
      oh_employee_documents_expiry/static/description/email.png
  16. BIN
      oh_employee_documents_expiry/static/description/icon.png
  17. 127
      oh_employee_documents_expiry/static/description/index.html
  18. BIN
      oh_employee_documents_expiry/static/description/oh_document_form.png
  19. BIN
      oh_employee_documents_expiry/static/description/oh_employee_fom.png
  20. 32
      oh_employee_documents_expiry/views/employee_check_list_view.xml
  21. 66
      oh_employee_documents_expiry/views/employee_document_view.xml

26
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

24
oh_employee_documents_expiry/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of OpenHRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Nilmar Shereef (<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

45
oh_employee_documents_expiry/__manifest__.py

@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of OpenHRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Nilmar Shereef (<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': '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,
}

23
oh_employee_documents_expiry/data/data.xml

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="entry_document1" model="employee.checklist">
<field name="name">Education Certificate</field>
<field name="document_type">entry</field>
</record>
<record id="entry_document2" model="employee.checklist">
<field name="name">Salary Certificate</field>
<field name="document_type">entry</field>
</record>
<record id="entry_document3" model="employee.checklist">
<field name="name">Experience Certificate</field>
<field name="document_type">entry</field>
</record>
<record id="exit_document1" model="employee.checklist">
<field name="name">Experience Certificate</field>
<field name="document_type">exit</field>
</record>
<record id="exit_document2" model="employee.checklist">
<field name="name">Salary Certificate</field>
<field name="document_type">exit</field>
</record>
</odoo>

6
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

25
oh_employee_documents_expiry/models/__init__.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of OpenHRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Nilmar Shereef (<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 employee_documents
from . import employee_entry_exit_check_list

104
oh_employee_documents_expiry/models/employee_documents.py

@ -0,0 +1,104 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of OpenHRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Nilmar Shereef (<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, 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 + ",<br>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': _('''<p class="oe_view_nocontent_create">
Click to Create for New Documents
</p>'''),
'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)

49
oh_employee_documents_expiry/models/employee_entry_exit_check_list.py

@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of OpenHRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Nilmar Shereef (<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 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)

7
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
1 id name model_id/id group_id/id perm_read perm_write perm_create perm_unlink
2 access_hr_employee_checklist_user employee.checklist.user model_employee_checklist hr.group_hr_user 1 1 1 1
3 access_hr_employee_checklist_emp employee.checklist.emp model_employee_checklist base.group_user 1 0 0 0
4 access_hr_employee_document_employee hr.employee.document_employee model_hr_employee_document base.group_user 1 0 0 0
5 access_hr_employee_document_manager hr.employee.document_manager model_hr_employee_document hr.group_hr_manager 1 1 1 1
6 access_hr_employee_document_user hr.employee.document_user model_hr_employee_document hr.group_hr_user 1 1 1 0

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
oh_employee_documents_expiry/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

BIN
oh_employee_documents_expiry/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
oh_employee_documents_expiry/static/description/document_form.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
oh_employee_documents_expiry/static/description/email.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
oh_employee_documents_expiry/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

127
oh_employee_documents_expiry/static/description/index.html

@ -0,0 +1,127 @@
<section class="oe_container">
<div class="oe_row">
<h2 class="oe_slogan">OpenHRMS</h2>
<h3 class="oe_slogan">Most advanced open source HR management software</h3>
</div>
</section>
<section class="oe_container">
<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">OHRMS Employee Documents</h2>
<h3 class="oe_slogan">Manages Employee Related Documents</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> Managing Documents of Employees.<br/>
<span style="color:green;"> &#9745; </span> Documents Types.<br/>
<span style="color:green;"> &#9745; </span> Expiry Date for Documents.<br/>
<span style="color:green;"> &#9745; </span> Validation for Expiry Date.<br/>
<span style="color:green;"> &#9745; </span> Mail Notification Based on Expiry Date.<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" style="text-align: justify;">
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)
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div style="text-align: center">
<p>
<h4>Documents Super Button</h4>
<p>
</div>
<div style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height: 400px;" src="oh_employee_fom.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Documents Form</h3>
<div style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height: 400px;" src="oh_document_form.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Notification Mail for Expiry Doc</h3>
<div style="text-align: center">
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;" src="email.png">
</div>
</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"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/contact/"><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.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
</div>
</section>

BIN
oh_employee_documents_expiry/static/description/oh_document_form.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
oh_employee_documents_expiry/static/description/oh_employee_fom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

32
oh_employee_documents_expiry/views/employee_check_list_view.xml

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model='ir.ui.view' id='employee_check_list_form_view'>
<field name="name">employee.checklist.form</field>
<field name="model">employee.checklist</field>
<field name="arch" type="xml">
<form string="Checklist">
<sheet>
<group>
<field name="name"/>
<field name="document_type"/>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record model='ir.ui.view' id='employee_check_list_tree_view'>
<field name="name">employee.checklist.tree</field>
<field name="model">employee.checklist</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="document_type"/>
</tree>
</field>
</record>
</odoo>

66
oh_employee_documents_expiry/views/employee_document_view.xml

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<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" eval="'hr.employee.document'"/>
<field name="function" eval="'mail_reminder'"/>
<field name="args" eval="'()'" />
</record>
<record model='ir.ui.view' id='employee_document_form_view'>
<field name="name">hr.employee.document.form</field>
<field name="model">hr.employee.document</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<group>
<field name="name"/>
<field name="document_name"/>
<field name="doc_attachment_id" widget="many2many_binary" class="oe_inline"/>
<field name="employee_ref" invisible="1"/>
</group>
<group>
<field name="issue_date"/>
<field name="expiry_date"/>
</group>
</group>
<notebook>
<page string="Description">
<field name="description"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record model='ir.ui.view' id='employee_document_tree_view'>
<field name="name">hr.employee.document.tree</field>
<field name="model">hr.employee.document</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="issue_date"/>
<field name="expiry_date"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="hr_employee_document_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">
<div class="oe_button_box" position="inside">
<button class="oe_stat_button" name="document_view" type="object" icon="fa-list-ol">
<field string="Documents" name="document_count" widget="statinfo"/>
</button>
</div>
</field>
</record>
</odoo>
Loading…
Cancel
Save