diff --git a/hr_appraisal/README.rst b/hr_appraisal/README.rst new file mode 100644 index 000000000..fc50d4680 --- /dev/null +++ b/hr_appraisal/README.rst @@ -0,0 +1,38 @@ +OHRMS Employee Appraisal v10 +============================ + +Roll out appraisal plans and get the best of your workforce + +Depends +======= +[hr] addon Odoo + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/10.0/setup/install.html +- Install our custom addon + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developer: Saritha Sahadevan @ cybrosys, saritha@cybrosys.in + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/hr_appraisal/RELEASE_NOTES.md b/hr_appraisal/RELEASE_NOTES.md new file mode 100644 index 000000000..0b2377d4a --- /dev/null +++ b/hr_appraisal/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module hr_appraisal + +#### 30.03.2018 +#### Version 10.0.1.0.0 +##### ADD +- Initial commit for OpenHrms Project diff --git a/hr_appraisal/__init__.py b/hr_appraisal/__init__.py new file mode 100644 index 000000000..165da63ed --- /dev/null +++ b/hr_appraisal/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHrms Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Saritha Sahadevan () +# +# 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 . +# +################################################################################### + +from . import models diff --git a/hr_appraisal/__manifest__.py b/hr_appraisal/__manifest__.py new file mode 100644 index 000000000..fe23fed69 --- /dev/null +++ b/hr_appraisal/__manifest__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHrms Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Saritha Sahadevan () +# +# 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 . +# +################################################################################### +{ + 'name': "OHRMS Employee Appraisal", + 'version': '10.0.1.0', + 'summary': """Roll out appraisal plans and get the best of your workforce""", + 'description': """Roll out appraisal plans and get the best of your workforce""", + 'category': 'Human Resources', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.openhrms.com", + 'depends': ['base', 'hr', 'survey'], + 'data': [ + 'security/ir.model.access.csv', + 'security/hr_appraisal_security.xml', + 'views/hr_appraisal_survey_views.xml', + 'views/hr_appraisal_form_view.xml', + 'data/hr_appraisal_stages.xml' + ], + 'images': ["static/description/banner.gif"], + 'license': "AGPL-3", + 'installable': True, + 'application': True, + +} diff --git a/hr_appraisal/data/hr_appraisal_stages.xml b/hr_appraisal/data/hr_appraisal_stages.xml new file mode 100644 index 000000000..c5a986e30 --- /dev/null +++ b/hr_appraisal/data/hr_appraisal_stages.xml @@ -0,0 +1,24 @@ + + + + + To Start + 1 + + + + Sent Mail + 2 + + + + Done + 3 + + + + Cancel + 4 + + + diff --git a/hr_appraisal/models/__init__.py b/hr_appraisal/models/__init__.py new file mode 100644 index 000000000..630926b39 --- /dev/null +++ b/hr_appraisal/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHrms Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Saritha Sahadevan () +# +# 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 . +# +################################################################################### + +from . import hr_appraisal_survey, hr_appraisal_form diff --git a/hr_appraisal/models/hr_appraisal_form.py b/hr_appraisal/models/hr_appraisal_form.py new file mode 100644 index 000000000..23d10fbc1 --- /dev/null +++ b/hr_appraisal/models/hr_appraisal_form.py @@ -0,0 +1,192 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHrms Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Saritha Sahadevan () +# +# 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 . +# +################################################################################### +from odoo import models, fields, api, SUPERUSER_ID + + +class HrAppraisalForm(models.Model): + _name = 'hr.appraisal' + _inherit = 'mail.thread' + _rec_name = 'emp_id' + _description = 'Appraisal' + + @api.model + def _read_group_stage_ids(self, categories, domain, order): + """ Read all the stages and display it in the kanban view, even if it is empty.""" + category_ids = categories._search([], order=order, access_rights_uid=SUPERUSER_ID) + return categories.browse(category_ids) + + def _default_stage_id(self): + """Setting default stage""" + rec = self.env['hr.appraisal.stages'].search([], limit=1, order='sequence ASC') + return rec.id if rec else None + + emp_id = fields.Many2one('hr.employee', string="Employee", required=True) + appraisal_deadline = fields.Date(string="Appraisal Deadline", required=True) + final_interview = fields.Date(string="Final Interview") + company_id = fields.Many2one('res.company', string='Company', default=lambda self: self.env.user.company_id) + hr_manager = fields.Boolean(string="Manager", default=False) + hr_emp = fields.Boolean(string="Employee", default=False) + hr_colloborator = fields.Boolean(string="Collaborators", default=False) + hr_colleague = fields.Boolean(string="Colleague", default=False) + hr_manager_id = fields.Many2many('hr.employee', 'manager_appraisal_rel', string="Select Appraisal Reviewer") + hr_colleague_id = fields.Many2many('hr.employee', 'colleagues_appraisal_rel', + string="Select Appraisal Reviewer") + hr_colloborator_id = fields.Many2many('hr.employee', 'colloborators_appraisal_rel', + string="Select Appraisal Reviewer") + manager_survey_id = fields.Many2one('survey.survey', string="Select Opinion Form") + emp_survey_id = fields.Many2one('survey.survey', string="Select Appraisal Form") + colloborator_survey_id = fields.Many2one('survey.survey', string="Select Opinion Form") + colleague_survey_id = fields.Many2one('survey.survey', string="Select Opinion Form") + response_id = fields.Many2one('survey.user_input', "Response", ondelete="set null", oldname="response") + final_evaluation = fields.Text(string="Final Evaluation") + app_period_from = fields.Date("From", required=True, readonly=True, default=fields.Datetime.now()) + tot_comp_survey = fields.Integer(string="Count Answers", compute="_compute_completed_survey") + tot_sent_survey = fields.Integer(string="Count Sent Questions") + created_by = fields.Many2one('res.users', string="Created By", default=lambda self: self.env.uid) + state = fields.Many2one('hr.appraisal.stages', string='Stage', track_visibility='onchange', index=True, + default=lambda self: self._default_stage_id(), + group_expand='_read_group_stage_ids') + # for coloring the kanban box + color = fields.Integer(string="Color Index") + check_sent = fields.Boolean(string="Check Sent Mail", default=False, copy=False) + check_draft = fields.Boolean(string="Check Draft", default=True, copy=False) + check_cancel = fields.Boolean(string="Check Cancel", default=False, copy=False) + check_done = fields.Boolean(string="Check Done", default=False, copy=False) + + @api.multi + def action_done(self): + rec = self.env['hr.appraisal.stages'].search([('sequence', '=', 3)]) + self.state = rec.id + self.check_done = True + self.check_draft = False + + @api.multi + def action_set_draft(self): + rec = self.env['hr.appraisal.stages'].search([('sequence', '=', 1)]) + self.state = rec.id + self.check_draft = True + self.check_sent = False + + @api.multi + def action_cancel(self): + rec = self.env['hr.appraisal.stages'].search([('sequence', '=', 4)]) + self.state = rec.id + self.check_cancel = True + self.check_draft = False + + @api.multi + def fetch_appraisal_reviewer(self): + appraisal_reviewers = [] + if self.hr_manager and self.hr_manager_id and self.manager_survey_id: + appraisal_reviewers.append((self.hr_manager_id, self.manager_survey_id)) + if self.hr_emp and self.emp_survey_id: + appraisal_reviewers.append((self.emp_id, self.emp_survey_id)) + if self.hr_colloborator and self.hr_colloborator_id and self.colloborator_survey_id: + appraisal_reviewers.append((self.hr_colloborator_id, self.colloborator_survey_id)) + if self.hr_colleague and self.hr_colleague_id and self.colleague_survey_id: + appraisal_reviewers.append((self.hr_colleague_id, self.colleague_survey_id)) + return appraisal_reviewers + + @api.multi + def action_start_appraisal(self): + """ This function will start the appraisal by sending emails to the corresponding employees + specified in the appraisal""" + send_count = 0 + appraisal_reviewers_list = self.fetch_appraisal_reviewer() + for appraisal_reviewers, survey_id in appraisal_reviewers_list: + for reviewers in appraisal_reviewers: + url = survey_id.public_url + response = self.env['survey.user_input'].create( + {'survey_id': survey_id.id, 'partner_id': reviewers.user_id.partner_id.id, + 'appraisal_id': self.ids[0], 'deadline': self.appraisal_deadline, 'email': reviewers.user_id.email}) + token = response.token + if token: + url = url + '/' + token + mail_content = "Dear " + reviewers.name + "," + "
Please fill out the following survey " \ + "related to " + self.emp_id.name + "
Click here to access the survey.
" + \ + str(url) + "
Post your response for the appraisal till : " + str(self.appraisal_deadline) + values = {'model': 'hr.appraisal', + 'res_id': self.ids[0], + 'subject': survey_id.title, + 'body_html': mail_content, + 'parent_id': None, + 'email_from': self.env.user.email or None, + 'auto_delete': True, + } + values['email_to'] = reviewers.work_email + result = self.env['mail.mail'].create(values).send() + if result is True: + send_count += 1 + self.write({'tot_sent_survey': send_count}) + rec = self.env['hr.appraisal.stages'].search([('sequence', '=', 2)]) + self.state = rec.id + self.check_sent = True + self.check_draft = False + + if self.hr_emp and self.emp_survey_id: + self.ensure_one() + if not self.response_id: + response = self.env['survey.user_input'].create( + {'survey_id': self.emp_survey_id.id, 'partner_id': self.emp_id.user_id.partner_id.id, + 'appraisal_id': self.ids[0], 'deadline': self.appraisal_deadline, 'email': reviewers.user_id.email}) + self.response_id = response.id + else: + response = self.response_id + return self.emp_survey_id.with_context(survey_token=response.token).action_start_survey() + + @api.multi + def action_get_answers(self): + """ This function will return all the answers posted related to this appraisal.""" + + tree_res = self.env['ir.model.data'].get_object_reference('survey', 'survey_user_input_tree') + tree_id = tree_res and tree_res[1] or False + form_res = self.env['ir.model.data'].get_object_reference('survey', 'survey_user_input_form') + form_id = form_res and form_res[1] or False + return { + 'model': 'ir.actions.act_window', + 'name': 'Answers', + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form,tree', + 'res_model': 'survey.user_input', + 'views': [(tree_id, 'tree'), (form_id, 'form')], + 'domain': [('state', '=', 'done'), ('appraisal_id', '=', self.ids[0])], + + } + + @api.one + def _compute_completed_survey(self): + + answers = self.env['survey.user_input'].search([('state', '=', 'done'), ('appraisal_id', '=', self.ids[0])]) + self.tot_comp_survey = len(answers) + + +class AppraisalStages(models.Model): + _name = 'hr.appraisal.stages' + _description = 'Appraisal Stages' + + name = fields.Char(string="Name") + sequence = fields.Integer(string="Sequence") + fold = fields.Boolean(string='Folded in Appraisal Pipeline', + help='This stage is folded in the kanban view when ' + 'there are no records in that stage to display.') diff --git a/hr_appraisal/models/hr_appraisal_survey.py b/hr_appraisal/models/hr_appraisal_survey.py new file mode 100644 index 000000000..172684cd9 --- /dev/null +++ b/hr_appraisal/models/hr_appraisal_survey.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +################################################################################### +# A part of OpenHrms Project +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Saritha Sahadevan () +# +# 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 . +# +################################################################################### + +from odoo import models, fields + + +class SurveyInput(models.Model): + _inherit = 'survey.user_input' + + appraisal_id = fields.Many2one('hr.appraisal', string="Appriasal id") diff --git a/hr_appraisal/security/hr_appraisal_security.xml b/hr_appraisal/security/hr_appraisal_security.xml new file mode 100644 index 000000000..eabb10277 --- /dev/null +++ b/hr_appraisal/security/hr_appraisal_security.xml @@ -0,0 +1,56 @@ + + + + Hr Appraisal Multi Company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + Appraisal + Helps to evaluate employees... + 3 + + + + Employee + + + + + + Manager + + + + + + + Appraisal Forms + [('created_by','=',user.id)] + + + + + + + + + + + Appraisal Forms + + + + + + + + + + + [('partner_id', '=', user.partner_id.id)] + + + diff --git a/hr_appraisal/security/ir.model.access.csv b/hr_appraisal/security/ir.model.access.csv new file mode 100644 index 000000000..7ac344fd1 --- /dev/null +++ b/hr_appraisal/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_hr_appraisal_hr_appraisal,hr_appraisal.hr_appraisal,model_hr_appraisal,,1,1,1,1 +access_hr_appraisal_hr_appraisal1,hr_appraisal.hr_appraisal_stages,model_hr_appraisal_stages,,1,1,1,1 diff --git a/hr_appraisal/static/description/HRMS-BUTTON.png b/hr_appraisal/static/description/HRMS-BUTTON.png new file mode 100644 index 000000000..0f1b65bea Binary files /dev/null and b/hr_appraisal/static/description/HRMS-BUTTON.png differ diff --git a/hr_appraisal/static/description/answers.png b/hr_appraisal/static/description/answers.png new file mode 100644 index 000000000..1eae4119b Binary files /dev/null and b/hr_appraisal/static/description/answers.png differ diff --git a/hr_appraisal/static/description/appraisal.png b/hr_appraisal/static/description/appraisal.png new file mode 100644 index 000000000..537932cb6 Binary files /dev/null and b/hr_appraisal/static/description/appraisal.png differ diff --git a/hr_appraisal/static/description/banner.jpg b/hr_appraisal/static/description/banner.jpg new file mode 100644 index 000000000..36530e574 Binary files /dev/null and b/hr_appraisal/static/description/banner.jpg differ diff --git a/hr_appraisal/static/description/cybro-service.png b/hr_appraisal/static/description/cybro-service.png new file mode 100644 index 000000000..252929a86 Binary files /dev/null and b/hr_appraisal/static/description/cybro-service.png differ diff --git a/hr_appraisal/static/description/cybro_logo.png b/hr_appraisal/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/hr_appraisal/static/description/cybro_logo.png differ diff --git a/hr_appraisal/static/description/email.png b/hr_appraisal/static/description/email.png new file mode 100644 index 000000000..ba236b416 Binary files /dev/null and b/hr_appraisal/static/description/email.png differ diff --git a/hr_appraisal/static/description/icon.png b/hr_appraisal/static/description/icon.png new file mode 100644 index 000000000..b4f716e94 Binary files /dev/null and b/hr_appraisal/static/description/icon.png differ diff --git a/hr_appraisal/static/description/index.html b/hr_appraisal/static/description/index.html new file mode 100644 index 000000000..87392a5a6 --- /dev/null +++ b/hr_appraisal/static/description/index.html @@ -0,0 +1,147 @@ +
+
+

OpenHRMS

+

Most advanced open source HR management software

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

Employee Appraisal

+

Roll out appraisal plans and get the best of your workforce.

+

Cybrosys Technologies

+
+
+

Major Features:

+
    +
  •   Create appraisal plans using interviews, questionnaires and feedback forms.
  • +
  •    Multiple appraisal methods like self-appraisal, colleague evaluation
  • +
+
+
+
+ +
+
+
+

Overview

+

+ Employee appraisal module is a component of Open HRMS suit, + it helps you to utilize the best of your human resource pool. + Implement appraisal strategies to keep the motivational and performance level + of your employees high. Appraisal module allows you to create Top Down or Bottom-up + evaluation plans and give timely feedbacks and complements for accomplishments. + +

+
+
+
+ +
+
+

Appraisal Menu

+
+
+ +
+
+
+

+ Create a form for evaluating employee.Option to create Top Down or Bottom-up evaluation plans. +

+
+
+
+ +
+
+

Email Notification

+
+

+ Email notification is sent to the corresponding employee including the link to participate in the survey + +

+
+
+
+ +
+
+
+
+
+
+

View Answers

+
+
+ +
+
+
+

You can view all the answers here

+ +
+
+
+ +
+
+

Settings Menu

+
+

Set access rights for the employees.

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

Our Odoo Services

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

Need Any Help?

+ +
+ diff --git a/hr_appraisal/static/description/settings.png b/hr_appraisal/static/description/settings.png new file mode 100644 index 000000000..15feb214b Binary files /dev/null and b/hr_appraisal/static/description/settings.png differ diff --git a/hr_appraisal/static/description/view_answers.png b/hr_appraisal/static/description/view_answers.png new file mode 100644 index 000000000..0dd0b7e14 Binary files /dev/null and b/hr_appraisal/static/description/view_answers.png differ diff --git a/hr_appraisal/views/hr_appraisal_form_view.xml b/hr_appraisal/views/hr_appraisal_form_view.xml new file mode 100644 index 000000000..acd193825 --- /dev/null +++ b/hr_appraisal/views/hr_appraisal_form_view.xml @@ -0,0 +1,181 @@ + + + + + hr.appraisal.form + hr.appraisal + 1 + +
+
+
+ +
+ +
+
+
+ + +
+
+
+
+
+ + + hr.appraisal.tree + hr.appraisal + + + + + + + + + + + + hr.appraisal.kanban + hr.appraisal + + + + + + +
+ +
+
+ oe_kanban_text_red + Deadline: +
+
+ Sent Questions: +
+
+ Answers: +
+
+ oe_kanban_text_red + Final Interview: +
+
+
+
+
+
+
+
+
+ + + Appraisal + hr.appraisal + form + + kanban,tree,form + + + + + +
\ No newline at end of file diff --git a/hr_appraisal/views/hr_appraisal_survey_views.xml b/hr_appraisal/views/hr_appraisal_survey_views.xml new file mode 100644 index 000000000..495a3e1c4 --- /dev/null +++ b/hr_appraisal/views/hr_appraisal_survey_views.xml @@ -0,0 +1,16 @@ + + + + + hr_appraisal list + survey.user_input + 1 + + + + + + + + + \ No newline at end of file