Browse Source

[FIX] Bug Fixed 'employee_documents_expiry'

pull/150/head
Ajmal JK 5 years ago
parent
commit
db3c8b8220
  1. 2
      employee_documents_expiry/__manifest__.py
  2. 45
      employee_documents_expiry/__manifest__.py~
  3. 5
      employee_documents_expiry/models/employee_documents.py
  4. 48
      employee_documents_expiry/models/employee_entry_exit_check_list.py~

2
employee_documents_expiry/__manifest__.py

@ -22,7 +22,7 @@
{
'name': 'Employee Documents',
'version': '12.0.1.0.0',
'version': '12.0.1.0.1',
'summary': """Manages Employee Documents With Expiry Notifications.""",
'description': """Manages Employee Related Documents with Expiry Notifications.""",
'category': 'Generic Modules/Human Resources',

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.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,
}

5
employee_documents_expiry/models/employee_documents.py

@ -51,8 +51,9 @@ class HrEmployeeDocument(models.Model):
def check_expr_date(self):
for each in self:
exp_date = each.expiry_date
if exp_date < date.today():
raise Warning('Your Document Is Already Expired.')
if exp_date:
if exp_date < date.today():
raise Warning('Your Document Is Already Expired.')
name = fields.Char(string='Document Number', required=True, copy=False)
document_name = fields.Many2one('employee.checklist', string='Document', required=True)

48
employee_documents_expiry/models/employee_entry_exit_check_list.py~

@ -1,48 +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/>.
#
##############################################################################
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)
Loading…
Cancel
Save