Browse Source

[UPDT] Added Name Get

pull/30/merge
SHEREEF PT 8 years ago
parent
commit
12bae19342
  1. 6
      employee_documents_expiry/__manifest__.py
  2. 45
      employee_documents_expiry/__manifest__.py~
  3. 10
      employee_documents_expiry/models/employee_documents.py
  4. 16
      employee_documents_expiry/models/employee_entry_exit_check_list.py
  5. BIN
      employee_documents_expiry/static/description/banner.jpg
  6. 2
      employee_documents_expiry/static/description/index.html
  7. 100
      employee_documents_expiry/static/description/index.html~

6
employee_documents_expiry/__manifest__.py

@ -22,10 +22,10 @@
##############################################################################
{
'name': 'Employee Documents',
'version': '10.0.1.0',
'summary': """Manages Employee Documents With Expiry Notifications""",
'version': '10.0.2.0',
'summary': """Manages Employee Documents With Expiry Notifications.""",
'description': """Manages Employee Related Documents with Expiry Notifications.""",
'category': 'Human Resources',
'category': 'Generic Modules/Human Resources',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',

45
employee_documents_expiry/__manifest__.py~

@ -1,45 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<https://www.cybrosys.com>)
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Employee Documents',
'version': '10.0.1.0',
'summary': """Manages Employee Documents""",
'description': """Manages Employee Related Documents with Expiry Notifications.""",
'category': '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,
}

10
employee_documents_expiry/models/employee_documents.py

@ -20,8 +20,9 @@
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from datetime import datetime, timedelta
from datetime import datetime,date, timedelta
from odoo import models, fields, api, _
from odoo.exceptions import Warning
class HrEmployeeDocument(models.Model):
@ -46,6 +47,13 @@ class HrEmployeeDocument(models.Model):
}
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)

16
employee_documents_expiry/models/employee_entry_exit_check_list.py

@ -20,7 +20,7 @@
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from odoo import models, fields
from odoo import models, fields, api
class EmployeeEntryDocuments(models.Model):
@ -28,7 +28,21 @@ class EmployeeEntryDocuments(models.Model):
_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)

BIN
employee_documents_expiry/static/description/banner.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 125 KiB

2
employee_documents_expiry/static/description/index.html

@ -8,7 +8,9 @@
<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>

100
employee_documents_expiry/static/description/index.html~

@ -1,100 +0,0 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">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> Expiry Date for Documents.<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="employee_form.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="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>
<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>
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td>
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td>
</div>
</div>
</section>
Loading…
Cancel
Save