Browse Source

[ADD] Initial Commit

pull/72/head
Sreejith P 7 years ago
parent
commit
44ed9e1e94
  1. 26
      oh_employee_documents_expiry/README.md
  2. 24
      oh_employee_documents_expiry/__init__.py
  3. 43
      oh_employee_documents_expiry/__manifest__.py
  4. 6
      oh_employee_documents_expiry/docs/RELEASE_NOTES.md
  5. 24
      oh_employee_documents_expiry/models/__init__.py
  6. BIN
      oh_employee_documents_expiry/models/__pycache__/__init__.cpython-35.pyc
  7. BIN
      oh_employee_documents_expiry/models/__pycache__/employee_documents.cpython-35.pyc
  8. 106
      oh_employee_documents_expiry/models/employee_documents.py
  9. 5
      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. 135
      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. 65
      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 Open HRMS 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

43
oh_employee_documents_expiry/__manifest__.py

@ -0,0 +1,43 @@
# -*- 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: 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': 'Open HRMS Employee Documents',
'version': '11.0.1.0.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_document_view.xml',
],
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

6
oh_employee_documents_expiry/docs/RELEASE_NOTES.md

@ -0,0 +1,6 @@
## Module 'oh_employee_documents_expiry'
#### 30.03.2018
#### Version 11.0.1.0.0
##### ADD
- Initial commit for Open HRMS Project

24
oh_employee_documents_expiry/models/__init__.py

@ -0,0 +1,24 @@
# -*- 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: 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

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

Binary file not shown.

BIN
oh_employee_documents_expiry/models/__pycache__/employee_documents.cpython-35.pyc

Binary file not shown.

106
oh_employee_documents_expiry/models/employee_documents.py

@ -0,0 +1,106 @@
# -*- 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: 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):
"""Sending document expiry notification to employees."""
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, help='You can give your'
'Document number.')
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)

5
oh_employee_documents_expiry/security/ir.model.access.csv

@ -0,0 +1,5 @@
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
"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_document_employee hr.employee.document_employee model_hr_employee_document base.group_user 1 0 0 0
3 access_hr_employee_document_manager hr.employee.document_manager model_hr_employee_document hr.group_hr_manager 1 1 1 1
4 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

135
oh_employee_documents_expiry/static/description/index.html

@ -0,0 +1,135 @@
<section class="oe_container">
<div class="oe_row">
<h2 class="oe_slogan">Open HRMS</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">Open HRMS 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/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
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

65
oh_employee_documents_expiry/views/employee_document_view.xml

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.cron" id="employee_data_reminder">
<field name="name">Employee Document 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_document"/>
<field name="state">code</field>
<field name="code">model.mail_reminder()</field>
</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="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