-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
177 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
================= | ||
Hr Evaluation 360 | ||
================= | ||
|
||
360-degree feedback | ||
|
||
Installation | ||
============ | ||
|
||
To install this module, you need to: | ||
|
||
#. Do this ... | ||
|
||
Configuration | ||
============= | ||
|
||
To configure this module, you need to: | ||
|
||
#. Go to ... | ||
|
||
Usage | ||
===== | ||
|
||
To use this module, you need to: | ||
|
||
#. Go to ... | ||
|
||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas | ||
:alt: Try me on Runbot | ||
:target: https://runbot.odoo-community.org/runbot/{repo_id}/{branch} | ||
|
||
.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt | ||
.. branch is "8.0" for example | ||
Known issues / Roadmap | ||
====================== | ||
|
||
* ... | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/OCA/{project_repo}/issues>`_. In case of trouble, please | ||
check there if your issue has already been reported. If you spotted it first, | ||
help us smashing it by providing a detailed and welcomed feedback. | ||
|
||
Credits | ||
======= | ||
|
||
Images | ||
------ | ||
|
||
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_. | ||
|
||
Contributors | ||
------------ | ||
|
||
* Firstname Lastname <email.address@example.org> | ||
* Second Person <second.person@example.org> | ||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
This module is maintained by the OCA. | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
To contribute to this module, please visit https://odoo-community.org. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2016 KMEE | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
'name': 'Hr Evaluation 360', | ||
'summary': """ | ||
360-degree feedback""", | ||
'version': '8.0.0.0.0', | ||
'license': 'AGPL-3', | ||
'author': 'KMEE,Odoo Community Association (OCA)', | ||
'website': 'www.kmee.com.br', | ||
'depends': [ | ||
'hr_evaluation' | ||
], | ||
'data': [ | ||
], | ||
'demo': [ | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import hr_evaluation_plan_phase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2016 Luis Felipe Mileo - <mileo@kmee.com.br> - KMEE | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
|
||
from datetime import datetime | ||
from dateutil.relativedelta import relativedelta | ||
from dateutil import parser | ||
import time | ||
|
||
from openerp import api, fields, models, _ | ||
|
||
|
||
class HrEvaluationPlanPhase(models.Model): | ||
|
||
_inherit = 'hr_evaluation.plan.phase' | ||
|
||
action = fields.Selection( | ||
selection_add=[ | ||
('360', u'360-degree feedback'), | ||
] | ||
) | ||
|
||
|
||
class HrEvaluationEvaluation(models.Model): | ||
|
||
_inherit = 'hr_evaluation.evaluation' | ||
|
||
@api.multi | ||
def button_plan_in_progress(self): | ||
hr_eval_inter_obj = self.env['hr.evaluation.interview'] | ||
for evaluation in self: | ||
wait = False | ||
for phase in evaluation.plan_id.phase_ids: | ||
if phase.action != '360': | ||
return super(HrEvaluationEvaluation, | ||
self).button_plan_in_progress() | ||
children = [] | ||
children = evaluation.employee_id.child_ids | ||
children.append(evaluation.employee_id.parent_id) | ||
|
||
for child in children: | ||
int_id = hr_eval_inter_obj.create({ | ||
'evaluation_id': evaluation.id, | ||
'phase_id': phase.id, | ||
'deadline': ( | ||
parser.parse( | ||
datetime.now().strftime('%Y-%m-%d') | ||
) + relativedelta(months=+1)).strftime( | ||
'%Y-%m-%d'), | ||
'user_id': child.user_id.id, | ||
}) | ||
if phase.wait: | ||
wait = True | ||
if not wait: | ||
hr_eval_inter_obj.survey_req_waiting_answer([int_id]) | ||
|
||
if (not wait) and phase.mail_feature: | ||
body = phase.mail_body % { | ||
'employee_name': child.name, | ||
'user_signature': child.user_id.signature, | ||
'eval_name': phase.survey_id.title, | ||
'date': time.strftime('%Y-%m-%d'), | ||
'time': time, | ||
} | ||
sub = phase.email_subject | ||
if child.work_email: | ||
vals = { | ||
'state': 'outgoing', | ||
'subject': sub, | ||
'body_html': '<pre>%s</pre>' % body, | ||
'email_to': child.work_email, | ||
'email_from': evaluation.employee_id.work_email | ||
} | ||
self.env['mail.mail'].create(vals) | ||
self.write({'state': 'wait'}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.