diff --git a/employee_stages/__init__.py b/employee_stages/__init__.py new file mode 100644 index 000000000..7c71921f5 --- /dev/null +++ b/employee_stages/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Jesni Banu(jesni@cybrosys.in) +# 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 . +# +############################################################################## +import models + diff --git a/employee_stages/__manifest__.py b/employee_stages/__manifest__.py new file mode 100644 index 000000000..e2812fb59 --- /dev/null +++ b/employee_stages/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Jesni Banu(jesni@cybrosys.in) +# 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 Stages', + 'version': '10.0.1.0.0', + 'summary': """Manages Employee Stages""", + 'description': """This module is used to tracking the employee's different stages.""", + 'category': "Generic Modules/Human Resources", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'hr'], + 'data': [ + 'security/ir.model.access.csv', + 'views/employee_stages_view.xml', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} + + diff --git a/employee_stages/models/__init__.py b/employee_stages/models/__init__.py new file mode 100644 index 000000000..24545a3c9 --- /dev/null +++ b/employee_stages/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Jesni Banu(jesni@cybrosys.in) +# 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 . +# +############################################################################## +import employee_stages + diff --git a/employee_stages/models/employee_stages.py b/employee_stages/models/employee_stages.py new file mode 100644 index 000000000..d47c42336 --- /dev/null +++ b/employee_stages/models/employee_stages.py @@ -0,0 +1,148 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Jesni Banu(jesni@cybrosys.in) +# 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 . +# +############################################################################## +from datetime import date +from odoo import models, fields, api + +emp_stages = [('joined', 'Slap On'), + ('grounding', 'Grounding'), + ('test_period', 'Test Period'), + ('employment', 'Employment'), + ('notice_period', 'Notice Period'), + ('relieved', 'Resigned'), + ('terminate', 'Terminated')] + + +class EmployeeFormInherit(models.Model): + _inherit = 'hr.employee' + + @api.model + def create(self, vals): + result = super(EmployeeFormInherit, self).create(vals) + result.stages_history.sudo().create({'start_date': date.today(), + 'employee_id': result.id, + 'state': 'joined'}) + return result + + @api.multi + def start_grounding(self): + self.state = 'grounding' + self.stages_history.sudo().create({'start_date': date.today(), + 'employee_id': self.id, + 'state': 'grounding'}) + + @api.multi + def set_as_employee(self): + self.state = 'employment' + stage_obj = self.stages_history.search([('employee_id', '=', self.id), + ('state', '=', 'test_period')]) + if stage_obj: + stage_obj.sudo().write({'end_date': date.today()}) + self.stages_history.sudo().create({'start_date': date.today(), + 'employee_id': self.id, + 'state': 'employment'}) + + @api.multi + def start_notice_period(self): + self.state = 'notice_period' + stage_obj = self.stages_history.search([('employee_id', '=', self.id), + ('state', '=', 'employment')]) + if stage_obj: + stage_obj.sudo().write({'end_date': date.today()}) + self.stages_history.sudo().create({'start_date': date.today(), + 'employee_id': self.id, + 'state': 'notice_period'}) + + @api.multi + def relived(self): + self.state = 'relieved' + self.active = False + stage_obj = self.stages_history.search([('employee_id', '=', self.id), + ('state', '=', 'notice_period')]) + if stage_obj: + stage_obj.sudo().write({'end_date': date.today()}) + self.stages_history.sudo().create({'end_date': date.today(), + 'employee_id': self.id, + 'state': 'relieved'}) + + @api.multi + def start_test_period(self): + self.state = 'test_period' + self.stages_history.search([('employee_id', '=', self.id), + ('state', '=', 'grounding')]).sudo().write({'end_date': date.today()}) + self.stages_history.sudo().create({'start_date': date.today(), + 'employee_id': self.id, + 'state': 'test_period'}) + + @api.multi + def terminate(self): + self.state = 'terminate' + self.active = False + stage_obj = self.stages_history.search([('employee_id', '=', self.id), + ('state', '=', 'employment')]) + + if stage_obj: + stage_obj.sudo().write({'end_date': date.today()}) + else: + self.stages_history.search([('employee_id', '=', self.id), + ('state', '=', 'grounding')]).sudo().write({'end_date': date.today()}) + self.stages_history.sudo().create({'end_date': date.today(), + 'employee_id': self.id, + 'state': 'terminate'}) + + state = fields.Selection(emp_stages, string='Status', default='joined', track_visibility='always', copy=False, + help="Employee Stages.\nSlap On: Joined\nGrounding: Training\nTest period : Probation") + stages_history = fields.One2many('hr.employee.status.history', 'employee_id', string='Stage History', + help='It shows the duration and history of each stages') + + +class EmployeeStageHistory(models.Model): + _name = 'hr.employee.status.history' + _description = 'Status History' + + @api.depends('end_date') + def get_duration(self): + for each in self: + if each.end_date and each.start_date: + duration = fields.Date.from_string(each.end_date) - fields.Date.from_string(each.start_date) + each.duration = duration.days + + start_date = fields.Date(string='Start Date') + end_date = fields.Date(string='End Date') + duration = fields.Integer(compute=get_duration, string='Duration(days)') + state = fields.Selection(emp_stages, string='Stage') + employee_id = fields.Many2one('hr.employee', invisible=1) + + +class WizardEmployee(models.TransientModel): + _name = 'wizard.employee.stage' + + @api.multi + def set_as_employee(self): + context = self._context + employee_obj = self.env['hr.employee'].search([('id', '=', context.get('employee_id'))]) + if self.related_user: + employee_obj.user_id = self.related_user + employee_obj.set_as_employee() + + related_user = fields.Many2one('res.users', string="Related User") + diff --git a/employee_stages/security/ir.model.access.csv b/employee_stages/security/ir.model.access.csv new file mode 100644 index 000000000..fb8ce590e --- /dev/null +++ b/employee_stages/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_wizard_employee_stage_manager,wizard.employee.stage.manager,model_wizard_employee_stage,hr.group_hr_manager,1,1,1,1 +access_wizard_employee_stage_hr_user,wizard.employee.stage.user,model_wizard_employee_stage,hr.group_hr_user,1,1,1,0 +access_hr_employee_status_history_manager,hr.employee.status.history.manager,model_hr_employee_status_history,hr.group_hr_manager,1,1,1,1 +access_hr_employee_status_history_hr_user,hr.employee.status.history.user,model_hr_employee_status_history,hr.group_hr_user,1,1,1,0 + + diff --git a/employee_stages/static/description/banner.jpg b/employee_stages/static/description/banner.jpg new file mode 100644 index 000000000..f0e59e5d5 Binary files /dev/null and b/employee_stages/static/description/banner.jpg differ diff --git a/employee_stages/static/description/cybro_logo.png b/employee_stages/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/employee_stages/static/description/cybro_logo.png differ diff --git a/employee_stages/static/description/filter.png b/employee_stages/static/description/filter.png new file mode 100644 index 000000000..c4982b897 Binary files /dev/null and b/employee_stages/static/description/filter.png differ diff --git a/employee_stages/static/description/groupby.png b/employee_stages/static/description/groupby.png new file mode 100644 index 000000000..20b0b3cf7 Binary files /dev/null and b/employee_stages/static/description/groupby.png differ diff --git a/employee_stages/static/description/icon.png b/employee_stages/static/description/icon.png new file mode 100644 index 000000000..7ca95a03f Binary files /dev/null and b/employee_stages/static/description/icon.png differ diff --git a/employee_stages/static/description/index.html b/employee_stages/static/description/index.html new file mode 100644 index 000000000..2e61151ff --- /dev/null +++ b/employee_stages/static/description/index.html @@ -0,0 +1,175 @@ +
+
+

Employee Stages

+

Manages Employee Stages

+

Cybrosys Technologies

+
+
+

Features:

+
+ Managing employee's different stages.
+ Added employee's current stage in tree view.
+ Added employee's current stage in kanban view.
+ Added group by stage in search view.
+ Added Employee filter in search view.
+ Added default search for employees in search bar.
+ Automatically recording the stage history.
+ Computing the duration of each stage.
+ Option to set 'Related User' while converting to the employee.
+ Automatically inactive the employee while terminating or relieving the employee.
+
+
+
+ +
+
+
+

Overview

+

+ Every employee may undergo different stages during his term in a company. + It may be probation, training, employment etc. The stages may vary according to the organisation. + It is important to track such stages systematically to assess the performance indices of + an employee. So here we are providing + a new module which will facilitate the management of different stages of an employee. +

+
+
+
+ +
+
+
+

+

Employee Stages

+

+

+
+ Here we can see different stages of employee, buttons to change the stages and overall history. +
+ +
+
+
+
+ +
+ Status History tab tracking the Start date, End date and Duration of each stages. +
+
+
+ +
+ When an employee's state is reached to 'Resigned' stage then the system will automatically + inactive this employee +
+
+
+ +
+
+
+

+

Option to Add Related User

+

+
+
+
+ +
+ We have an option to add 'Related User' when we set to 'Employment' stage. +
+
+
+ +
+
+
+

+

Kanban View

+

+
+
+
+ +
+
+
+
+ +
+
+
+

+

Tree View

+

+
+
+
+ +
+
+
+
+ +
+
+
+

+

Search Bar

+

+
+
+
+ +
+ In employees view we shows only the users which are in 'Employment' stage. +
+
+
+ +
+
+
+

+

Search View

+

+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
+ diff --git a/employee_stages/static/description/kanban.png b/employee_stages/static/description/kanban.png new file mode 100644 index 000000000..090edf6e1 Binary files /dev/null and b/employee_stages/static/description/kanban.png differ diff --git a/employee_stages/static/description/status1.png b/employee_stages/static/description/status1.png new file mode 100644 index 000000000..a2850ec01 Binary files /dev/null and b/employee_stages/static/description/status1.png differ diff --git a/employee_stages/static/description/status2.png b/employee_stages/static/description/status2.png new file mode 100644 index 000000000..9783c818e Binary files /dev/null and b/employee_stages/static/description/status2.png differ diff --git a/employee_stages/static/description/status3.png b/employee_stages/static/description/status3.png new file mode 100644 index 000000000..3ee31fc95 Binary files /dev/null and b/employee_stages/static/description/status3.png differ diff --git a/employee_stages/static/description/status5.png b/employee_stages/static/description/status5.png new file mode 100644 index 000000000..92a4415f7 Binary files /dev/null and b/employee_stages/static/description/status5.png differ diff --git a/employee_stages/static/description/status6.png b/employee_stages/static/description/status6.png new file mode 100644 index 000000000..568e68559 Binary files /dev/null and b/employee_stages/static/description/status6.png differ diff --git a/employee_stages/static/description/tree.png b/employee_stages/static/description/tree.png new file mode 100644 index 000000000..ee529a830 Binary files /dev/null and b/employee_stages/static/description/tree.png differ diff --git a/employee_stages/views/employee_stages_view.xml b/employee_stages/views/employee_stages_view.xml new file mode 100644 index 000000000..bed5b62b3 --- /dev/null +++ b/employee_stages/views/employee_stages_view.xml @@ -0,0 +1,120 @@ + + + + wizard.employee.form + wizard.employee.stage + +
+ + + +
+
+
+
+
+ + + Set as Employee + wizard.employee.stage + form + form + + new + + + + hr.employee.form.view + hr.employee + + + +
+
+
+ + + + + + + + + + + + +
+
+ + + hr.employee.tree.view + hr.employee + + + + + + + + + + hr.employee.search.view + hr.employee + + + + + + + + + + + + + + hr.employee.kanban.view + hr.employee + + + + + + +
  • +
    +
    +
    + + + Employees + hr.employee + form + kanban,tree,form + [] + {"search_default_employee":1} + + + +

    + Click to add a new employee. +

    + With just a quick glance on the Odoo employee screen, you + can easily find all the information you need for each person; + contact data, job position, availability, etc. +

    +
    +
    +