diff --git a/employee_documents_expiry/__manifest__.py b/employee_documents_expiry/__manifest__.py index cf0c82c9c..9aef8c8a3 100644 --- a/employee_documents_expiry/__manifest__.py +++ b/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', diff --git a/employee_documents_expiry/__manifest__.py~ b/employee_documents_expiry/__manifest__.py~ deleted file mode 100644 index 84a35b5be..000000000 --- a/employee_documents_expiry/__manifest__.py~ +++ /dev/null @@ -1,45 +0,0 @@ -# -*- 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.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, -} diff --git a/employee_documents_expiry/models/employee_documents.py b/employee_documents_expiry/models/employee_documents.py index c7490d0cc..4fdab208b 100644 --- a/employee_documents_expiry/models/employee_documents.py +++ b/employee_documents_expiry/models/employee_documents.py @@ -20,8 +20,9 @@ # If not, see . # ############################################################################## -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) diff --git a/employee_documents_expiry/models/employee_entry_exit_check_list.py b/employee_documents_expiry/models/employee_entry_exit_check_list.py index e175350a1..6fbd2c51d 100644 --- a/employee_documents_expiry/models/employee_entry_exit_check_list.py +++ b/employee_documents_expiry/models/employee_entry_exit_check_list.py @@ -20,7 +20,7 @@ # If not, see . # ############################################################################## -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) + diff --git a/employee_documents_expiry/static/description/banner.jpg b/employee_documents_expiry/static/description/banner.jpg index 931855443..70eda18cb 100644 Binary files a/employee_documents_expiry/static/description/banner.jpg and b/employee_documents_expiry/static/description/banner.jpg differ diff --git a/employee_documents_expiry/static/description/index.html b/employee_documents_expiry/static/description/index.html index 1a4d5e651..948cea538 100644 --- a/employee_documents_expiry/static/description/index.html +++ b/employee_documents_expiry/static/description/index.html @@ -8,7 +8,9 @@

Features:

Managing Documents of Employees.
+ Documents Types.
Expiry Date for Documents.
+ Validation for Expiry Date.
Mail Notification Based on Expiry Date.
diff --git a/employee_documents_expiry/static/description/index.html~ b/employee_documents_expiry/static/description/index.html~ deleted file mode 100644 index 1a4d5e651..000000000 --- a/employee_documents_expiry/static/description/index.html~ +++ /dev/null @@ -1,100 +0,0 @@ -
-
-

Employee Documents

-

Manages Employee Related Documents

-

Cybrosys Technologies

-
-
-

Features:

-
- Managing Documents of Employees.
- Expiry Date for Documents.
- 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?

- -
- - -