[IMP] hr_evaluation: in progress
bzr revid: chm@openerp.com-20130220160533-e39ss2c1i17er5yz
This commit is contained in:
@@ -27,6 +27,7 @@ import time
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
|
||||
|
||||
class hr_evaluation_plan(osv.osv):
|
||||
_name = "hr_evaluation.plan"
|
||||
_description = "Appraisal Plan"
|
||||
@@ -42,11 +43,12 @@ class hr_evaluation_plan(osv.osv):
|
||||
'active': True,
|
||||
'month_first': 6,
|
||||
'month_next': 12,
|
||||
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c),
|
||||
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c),
|
||||
}
|
||||
|
||||
hr_evaluation_plan()
|
||||
|
||||
|
||||
class hr_evaluation_plan_phase(osv.osv):
|
||||
_name = "hr_evaluation.plan.phase"
|
||||
_description = "Appraisal Plan Phase"
|
||||
@@ -55,13 +57,13 @@ class hr_evaluation_plan_phase(osv.osv):
|
||||
'name': fields.char("Phase", size=64, required=True),
|
||||
'sequence': fields.integer("Sequence"),
|
||||
'company_id': fields.related('plan_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
|
||||
'plan_id': fields.many2one('hr_evaluation.plan','Appraisal Plan', ondelete='cascade'),
|
||||
'plan_id': fields.many2one('hr_evaluation.plan', 'Appraisal Plan', ondelete='cascade'),
|
||||
'action': fields.selection([
|
||||
('top-down','Top-Down Appraisal Requests'),
|
||||
('bottom-up','Bottom-Up Appraisal Requests'),
|
||||
('self','Self Appraisal Requests'),
|
||||
('final','Final Interview')], 'Action', required=True),
|
||||
'survey_id': fields.many2one('survey','Appraisal Form',required=True),
|
||||
('top-down', 'Top-Down Appraisal Requests'),
|
||||
('bottom-up', 'Bottom-Up Appraisal Requests'),
|
||||
('self', 'Self Appraisal Requests'),
|
||||
('final', 'Final Interview')], 'Action', required=True),
|
||||
'survey_id': fields.many2one('survey', 'Appraisal Form', required=True),
|
||||
'send_answer_manager': fields.boolean('All Answers',
|
||||
help="Send all answers to the manager"),
|
||||
'send_answer_employee': fields.boolean('All Answers',
|
||||
@@ -73,15 +75,14 @@ class hr_evaluation_plan_phase(osv.osv):
|
||||
'wait': fields.boolean('Wait Previous Phases',
|
||||
help="Check this box if you want to wait that all preceding phases " +
|
||||
"are finished before launching this phase."),
|
||||
'mail_feature': fields.boolean('Send mail for this phase', help="Check this box if you want to send mail to employees"+
|
||||
" coming under this phase"),
|
||||
'mail_feature': fields.boolean('Send mail for this phase', help="Check this box if you want to send mail to employees coming under this phase"),
|
||||
'mail_body': fields.text('Email'),
|
||||
'email_subject':fields.text('char')
|
||||
'email_subject': fields.text('char')
|
||||
}
|
||||
_defaults = {
|
||||
'sequence': 1,
|
||||
'email_subject': _('''Regarding '''),
|
||||
'mail_body': lambda *a:_('''
|
||||
'mail_body': lambda *a: _('''
|
||||
Date: %(date)s
|
||||
|
||||
Dear %(employee_name)s,
|
||||
@@ -100,24 +101,26 @@ Thanks,
|
||||
|
||||
hr_evaluation_plan_phase()
|
||||
|
||||
|
||||
class hr_employee(osv.osv):
|
||||
_name = "hr.employee"
|
||||
_inherit="hr.employee"
|
||||
_inherit = "hr.employee"
|
||||
_columns = {
|
||||
'evaluation_plan_id': fields.many2one('hr_evaluation.plan', 'Appraisal Plan'),
|
||||
'evaluation_date': fields.date('Next Appraisal Date', help="The date of the next appraisal is computed by the appraisal plan's dates (first appraisal + periodicity)."),
|
||||
}
|
||||
|
||||
def run_employee_evaluation(self, cr, uid, automatic=False, use_new_cursor=False, context=None):
|
||||
now = parser.parse(datetime.now().strftime('%Y-%m-%d'))
|
||||
obj_evaluation = self.pool.get('hr_evaluation.evaluation')
|
||||
emp_ids =self.search(cr, uid, [ ('evaluation_plan_id','<>',False), ('evaluation_date','=', False)], context=context)
|
||||
emp_ids = self.search(cr, uid, [('evaluation_plan_id', '<>', False), ('evaluation_date', '=', False)], context=context)
|
||||
for emp in self.browse(cr, uid, emp_ids, context=context):
|
||||
first_date = (now+ relativedelta(months=emp.evaluation_plan_id.month_first)).strftime('%Y-%m-%d')
|
||||
first_date = (now + relativedelta(months=emp.evaluation_plan_id.month_first)).strftime('%Y-%m-%d')
|
||||
self.write(cr, uid, [emp.id], {'evaluation_date': first_date}, context=context)
|
||||
|
||||
emp_ids =self.search(cr, uid, [
|
||||
('evaluation_plan_id','<>',False), ('evaluation_date','<=', time.strftime("%Y-%m-%d")),
|
||||
], context=context)
|
||||
emp_ids = self.search(cr, uid, [
|
||||
('evaluation_plan_id', '<>', False), ('evaluation_date', '<=', time.strftime("%Y-%m-%d")),
|
||||
], context=context)
|
||||
for emp in self.browse(cr, uid, emp_ids, context=context):
|
||||
next_date = (now + relativedelta(months=emp.evaluation_plan_id.month_next)).strftime('%Y-%m-%d')
|
||||
self.write(cr, uid, [emp.id], {'evaluation_date': next_date}, context=context)
|
||||
@@ -125,6 +128,7 @@ class hr_employee(osv.osv):
|
||||
obj_evaluation.button_plan_in_progress(cr, uid, [plan_id], context=context)
|
||||
return True
|
||||
|
||||
|
||||
class hr_evaluation(osv.osv):
|
||||
_name = "hr_evaluation.evaluation"
|
||||
_inherit = "mail.thread"
|
||||
@@ -135,28 +139,27 @@ class hr_evaluation(osv.osv):
|
||||
'employee_id': fields.many2one('hr.employee', "Employee", required=True),
|
||||
'note_summary': fields.text('Appraisal Summary'),
|
||||
'note_action': fields.text('Action Plan',
|
||||
help="If the evaluation does not meet the expectations, you can propose"+
|
||||
"an action plan"),
|
||||
help="If the evaluation does not meet the expectations, you can propose an action plan"),
|
||||
'rating': fields.selection([
|
||||
('0','Significantly bellow expectations'),
|
||||
('1','Did not meet expectations'),
|
||||
('2','Meet expectations'),
|
||||
('3','Exceeds expectations'),
|
||||
('4','Significantly exceeds expectations'),
|
||||
('0', 'Significantly bellow expectations'),
|
||||
('1', 'Did not meet expectations'),
|
||||
('2', 'Meet expectations'),
|
||||
('3', 'Exceeds expectations'),
|
||||
('4', 'Significantly exceeds expectations'),
|
||||
], "Appreciation", help="This is the appreciation on which the evaluation is summarized."),
|
||||
'survey_request_ids': fields.one2many('hr.evaluation.interview','evaluation_id','Appraisal Forms'),
|
||||
'survey_response_ids': fields.one2many('hr.evaluation.interview', 'evaluation_id', 'Appraisal Forms'),
|
||||
'plan_id': fields.many2one('hr_evaluation.plan', 'Plan', required=True),
|
||||
'state': fields.selection([
|
||||
('draft','New'),
|
||||
('cancel','Cancelled'),
|
||||
('wait','Plan In Progress'),
|
||||
('progress','Waiting Appreciation'),
|
||||
('done','Done'),
|
||||
('draft', 'New'),
|
||||
('cancel', 'Cancelled'),
|
||||
('wait', 'Plan In Progress'),
|
||||
('progress', 'Waiting Appreciation'),
|
||||
('done', 'Done'),
|
||||
], 'Status', required=True, readonly=True),
|
||||
'date_close': fields.date('Ending Date', select=True),
|
||||
}
|
||||
_defaults = {
|
||||
'date': lambda *a: (parser.parse(datetime.now().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'),
|
||||
'date': lambda *a: (parser.parse(datetime.now().strftime('%Y-%m-%d')) + relativedelta(months=1)).strftime('%Y-%m-%d'),
|
||||
'state': lambda *a: 'draft',
|
||||
}
|
||||
|
||||
@@ -181,7 +184,6 @@ class hr_evaluation(osv.osv):
|
||||
return {'value': vals}
|
||||
|
||||
def button_plan_in_progress(self, cr, uid, ids, context=None):
|
||||
mail_message = self.pool.get('mail.message')
|
||||
hr_eval_inter_obj = self.pool.get('hr.evaluation.interview')
|
||||
if context is None:
|
||||
context = {}
|
||||
@@ -198,11 +200,15 @@ class hr_evaluation(osv.osv):
|
||||
children = [evaluation.employee_id]
|
||||
for child in children:
|
||||
|
||||
if (not child.user_id or not child.user_id.partner_id.id) and not child.work_email:
|
||||
raise osv.except_osv(_('Warning!'), _('%s have not related user name and have no email address.' % child.name))
|
||||
|
||||
int_id = hr_eval_inter_obj.create(cr, uid, {
|
||||
'evaluation_id': evaluation.id,
|
||||
'survey_id': phase.survey_id.id,
|
||||
'date_deadline': (parser.parse(datetime.now().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'),
|
||||
'user_id': child.user_id.id,
|
||||
'date_deadline': datetime.now() + relativedelta(months=1),
|
||||
'partner_id': child.user_id and child.user_id.partner_id.id or None,
|
||||
'email': child.work_email or None,
|
||||
'user_to_review_id': evaluation.employee_id.id
|
||||
}, context=context)
|
||||
if phase.wait:
|
||||
@@ -212,7 +218,7 @@ class hr_evaluation(osv.osv):
|
||||
|
||||
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 }
|
||||
'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',
|
||||
@@ -222,32 +228,32 @@ class hr_evaluation(osv.osv):
|
||||
'email_from': evaluation.employee_id.work_email}
|
||||
self.pool.get('mail.mail').create(cr, uid, vals, context=context)
|
||||
|
||||
self.write(cr, uid, ids, {'state':'wait'}, context=context)
|
||||
self.write(cr, uid, ids, {'state': 'wait'}, context=context)
|
||||
return True
|
||||
|
||||
def button_final_validation(self, cr, uid, ids, context=None):
|
||||
request_obj = self.pool.get('hr.evaluation.interview')
|
||||
self.write(cr, uid, ids, {'state':'progress'}, context=context)
|
||||
self.write(cr, uid, ids, {'state': 'progress'}, context=context)
|
||||
for evaluation in self.browse(cr, uid, ids, context=context):
|
||||
if evaluation.employee_id and evaluation.employee_id.parent_id and evaluation.employee_id.parent_id.user_id:
|
||||
self.message_subscribe_users(cr, uid, [evaluation.id], user_ids=[evaluation.employee_id.parent_id.user_id.id], context=context)
|
||||
if len(evaluation.survey_request_ids) != len(request_obj.search(cr, uid, [('evaluation_id', '=', evaluation.id),('state', 'in', ['done','cancel'])], context=context)):
|
||||
raise osv.except_osv(_('Warning!'),_("You cannot change state, because some appraisal(s) are in waiting answer or draft state."))
|
||||
if len(evaluation.survey_response_ids) != len(request_obj.search(cr, uid, [('evaluation_id', '=', evaluation.id), ('state', 'in', ['done', 'cancel'])], context=context)):
|
||||
raise osv.except_osv(_('Warning!'), _("You cannot change state, because some appraisal(s) are in waiting answer or draft state."))
|
||||
return True
|
||||
|
||||
def button_done(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids,{'state':'done', 'date_close': time.strftime('%Y-%m-%d')}, context=context)
|
||||
self.write(cr, uid, ids, {'state': 'done', 'date_close': time.strftime('%Y-%m-%d')}, context=context)
|
||||
return True
|
||||
|
||||
def button_cancel(self, cr, uid, ids, context=None):
|
||||
interview_obj=self.pool.get('hr.evaluation.interview')
|
||||
interview_obj = self.pool.get('hr.evaluation.interview')
|
||||
evaluation = self.browse(cr, uid, ids[0], context)
|
||||
interview_obj.survey_req_cancel(cr, uid, [r.id for r in evaluation.survey_request_ids])
|
||||
self.write(cr, uid, ids,{'state':'cancel'}, context=context)
|
||||
interview_obj.survey_req_cancel(cr, uid, [r.id for r in evaluation.survey_response_ids])
|
||||
self.write(cr, uid, ids, {'state': 'cancel'}, context=context)
|
||||
return True
|
||||
|
||||
def button_draft(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids,{'state': 'draft'}, context=context)
|
||||
self.write(cr, uid, ids, {'state': 'draft'}, context=context)
|
||||
return True
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
@@ -256,9 +262,9 @@ class hr_evaluation(osv.osv):
|
||||
if context is None:
|
||||
context = {}
|
||||
default = default.copy()
|
||||
default['survey_request_ids'] = []
|
||||
default['survey_response_ids'] = []
|
||||
return super(hr_evaluation, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if vals.get('employee_id'):
|
||||
employee_id = self.pool.get('hr.employee').browse(cr, uid, vals.get('employee_id'), context=context)
|
||||
@@ -268,47 +274,55 @@ class hr_evaluation(osv.osv):
|
||||
new_vals = {'date_deadline': vals.get('date')}
|
||||
obj_hr_eval_iterview = self.pool.get('hr.evaluation.interview')
|
||||
for evalutation in self.browse(cr, uid, ids, context=context):
|
||||
for survey_req in evalutation.survey_request_ids:
|
||||
for survey_req in evalutation.survey_response_ids:
|
||||
obj_hr_eval_iterview.write(cr, uid, [survey_req.id], new_vals, context=context)
|
||||
return super(hr_evaluation, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
hr_evaluation()
|
||||
|
||||
|
||||
class survey_request(osv.osv):
|
||||
_inherit = "survey.request"
|
||||
_inherit = "survey.response"
|
||||
_columns = {
|
||||
'is_evaluation': fields.boolean('Is Appraisal?'),
|
||||
}
|
||||
|
||||
survey_request()
|
||||
|
||||
|
||||
class hr_evaluation_interview(osv.osv):
|
||||
_name = 'hr.evaluation.interview'
|
||||
_inherits = {'survey.request': 'request_id'}
|
||||
_inherit = 'mail.thread'
|
||||
_rec_name = 'request_id'
|
||||
_inherits = {'survey.response': 'response_id'}
|
||||
_inherit = ['mail.thread', 'ir.needaction_mixin']
|
||||
_rec_name = 'response_id'
|
||||
_description = 'Appraisal Interview'
|
||||
_columns = {
|
||||
'request_id': fields.many2one('survey.request','Request_id', ondelete='cascade', required=True),
|
||||
'response_id': fields.many2one('survey.response', 'Request_id', ondelete='cascade', required=True),
|
||||
'user_to_review_id': fields.many2one('hr.employee', 'Employee to Interview'),
|
||||
'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Appraisal Form'),
|
||||
'user_id': fields.many2one('res.users', 'Interviewer', readonly=1),
|
||||
}
|
||||
_defaults = {
|
||||
'is_evaluation': True,
|
||||
}
|
||||
|
||||
def _needaction_domain_get(self, cr, uid, context=None):
|
||||
return ['|',
|
||||
'&', ('state', '=', 'done'), ('user_id', '=', uid),
|
||||
'&', ('state', 'in', ['new', 'skip']), ('user_to_review_id.user_id', '=', uid)]
|
||||
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
if not ids:
|
||||
return []
|
||||
reads = self.browse(cr, uid, ids, context=context)
|
||||
res = []
|
||||
for record in reads:
|
||||
name = record.request_id.survey_id.title
|
||||
name = record.response_id.survey_id.title
|
||||
res.append((record['id'], name))
|
||||
return res
|
||||
|
||||
def survey_req_waiting_answer(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, { 'state': 'waiting_answer'}, context=context)
|
||||
self.write(cr, uid, ids, {'state': 'new'}, context=context)
|
||||
return True
|
||||
|
||||
def survey_req_done(self, cr, uid, ids, context=None):
|
||||
@@ -317,25 +331,21 @@ class hr_evaluation_interview(osv.osv):
|
||||
flag = False
|
||||
wating_id = 0
|
||||
if not id.evaluation_id.id:
|
||||
raise osv.except_osv(_('Warning!'),_("You cannot start evaluation without Appraisal."))
|
||||
records = hr_eval_obj.browse(cr, uid, [id.evaluation_id.id], context=context)[0].survey_request_ids
|
||||
raise osv.except_osv(_('Warning!'), _("You cannot start evaluation without Appraisal."))
|
||||
records = hr_eval_obj.browse(cr, uid, [id.evaluation_id.id], context=context)[0].survey_response_ids
|
||||
for child in records:
|
||||
if child.state == "draft":
|
||||
if child.state == "new":
|
||||
wating_id = child.id
|
||||
continue
|
||||
if child.state != "done":
|
||||
flag = True
|
||||
if not flag and wating_id:
|
||||
self.survey_req_waiting_answer(cr, uid, [wating_id], context=context)
|
||||
self.write(cr, uid, ids, { 'state': 'done'}, context=context)
|
||||
return True
|
||||
|
||||
def survey_req_draft(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, { 'state': 'draft'}, context=context)
|
||||
self.write(cr, uid, ids, {'state': 'done'}, context=context)
|
||||
return True
|
||||
|
||||
def survey_req_cancel(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, { 'state': 'cancel'}, context=context)
|
||||
self.write(cr, uid, ids, {'state': 'cancel'}, context=context)
|
||||
return True
|
||||
|
||||
def action_print_survey(self, cr, uid, ids, context=None):
|
||||
@@ -353,7 +363,7 @@ class hr_evaluation_interview(osv.osv):
|
||||
context = {}
|
||||
record = self.browse(cr, uid, ids, context=context)
|
||||
record = record and record[0]
|
||||
context.update({'survey_id': record.survey_id.id, 'response_id': [record.response.id], 'response_no':0,})
|
||||
context.update({'survey_id': record.survey_id.id, 'response_id': [record.response_id.id], 'response_no': 0})
|
||||
value = self.pool.get("survey").action_print_survey(cr, uid, ids, context=context)
|
||||
return value
|
||||
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
<record id="survey_2" model="survey">
|
||||
<field name="title">Self Appraisal</field>
|
||||
<field name="max_response_limit">20</field>
|
||||
<field eval="[(6,0,[])]" name="users"/>
|
||||
<field name="type" ref="survey.survey_type1"/>
|
||||
<field name="responsible_id" ref="base.user_root"/>
|
||||
<field name="response_user">5</field>
|
||||
<field name="state">open</field>
|
||||
<field name="state">restricted</field>
|
||||
</record>
|
||||
<record id="survey_page_1" model="survey.page">
|
||||
<field name="title">Employee Appraisal Form</field>
|
||||
@@ -606,10 +604,8 @@ Once the form had been filled, the employee send it to his supervisor.
|
||||
<record id="survey_3" model="survey">
|
||||
<field name="title">Employee Opinion</field>
|
||||
<field name="max_response_limit">20</field>
|
||||
<field eval="[(6,0,[])]" name="users"/>
|
||||
<field name="type" ref="survey.survey_type1"/>
|
||||
<field name="responsible_id" ref="base.user_root"/>
|
||||
<field name="response_user">5</field>
|
||||
</record>
|
||||
<record id="survey_page_2" model="survey.page">
|
||||
<field name="title">Process</field>
|
||||
|
||||
@@ -175,27 +175,26 @@
|
||||
</group>
|
||||
</group>
|
||||
<group string="Appraisal Forms" attrs="{'invisible':[('state','=','draft')]}">
|
||||
<field nolabel="1" name="survey_request_ids">
|
||||
<field nolabel="1" name="survey_response_ids">
|
||||
<form string="Interview Appraisal" version="7.0">
|
||||
<div class="oe_right oe_button_box">
|
||||
<button name="%(survey.action_view_survey_question_message)d" string="Answer Survey" type="action" states="waiting_answer" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done" icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0,}" attrs="{'readonly':[('response','=',False)]}" />
|
||||
<button name="%(survey.action_view_survey_question_message)d" string="Answer Survey" type="action" states="waiting_answer" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [id], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done" icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [id], 'response_no':0,}"/>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="survey_id"/>
|
||||
<field name="user_to_review_id"/>
|
||||
<field name="user_id" string="Interviewer"/>
|
||||
<field name="user_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="date_deadline"/>
|
||||
<field name="response" readonly="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="4" string="Status" invisible="1">
|
||||
<field name="state"/>
|
||||
<div>
|
||||
<button string="Done" name="survey_req_done" states="waiting_answer" type="object" icon="gtk-jump-to" />
|
||||
<button string="Done" name="survey_req_done" states="new,skip" type="object" icon="gtk-jump-to" />
|
||||
</div>
|
||||
</group>
|
||||
</form>
|
||||
@@ -285,13 +284,13 @@
|
||||
<button string="Cancel" name="survey_req_cancel" type="object"
|
||||
states="draft,waiting_answer" class="oe_left"/>
|
||||
<button string="Print Survey" name="action_print_survey" type="object"
|
||||
states="draft" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0}"
|
||||
states="draft" context="{'survey_id': survey_id, 'response_id': [id], 'response_no':0}"
|
||||
attrs="{'readonly':[('survey_id','=',False)]}" class="oe_highlight"/>
|
||||
<button string="Send Request" name="survey_req_waiting_answer" type="object"
|
||||
states="draft" class="oe_highlight"/>
|
||||
<button string="Answer Survey" name="%(survey.action_view_survey_question_message)d" type="action"
|
||||
states="waiting_answer" class="oe_highlight"
|
||||
context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}"
|
||||
context="{'survey_id': survey_id, 'response_id': [id], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}"
|
||||
attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button string="Done" name="survey_req_done" type="object"
|
||||
states="waiting_answer"/>
|
||||
@@ -308,11 +307,11 @@
|
||||
<group>
|
||||
<field name="survey_id"/>
|
||||
<field name="user_to_review_id"/>
|
||||
<field name="user_id" string="Interviewer"/>
|
||||
<field name="user_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="date_deadline"/>
|
||||
<field name="response" readonly="1"/>
|
||||
<field name="state"/>
|
||||
<field name="evaluation_id" string="Appraisal Plan"/>
|
||||
</group>
|
||||
</group>
|
||||
@@ -328,15 +327,14 @@
|
||||
<tree string="Interview Appraisal">
|
||||
<field name="date_deadline" string="Deadline Date"/>
|
||||
<field name="survey_id"/>
|
||||
<field name="user_id" string="Interviewer"/>
|
||||
<field name="user_id"/>
|
||||
<field name="user_to_review_id"/>
|
||||
<field name="response" readonly="1" invisible="True"/>
|
||||
<button name="%(survey.action_view_survey_question_message)d" string="Answer Survey" type="action" states="waiting_answer" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response, 'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button name="action_print_survey" string="Print Survey" type="object" icon="gtk-print" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<field name="response_id" readonly="1" invisible="True"/>
|
||||
<button name="%(survey.action_view_survey_question_message)d" string="Answer Survey" type="action" states="waiting_answer" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [id], 'response_no':0, 'active' : response, 'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button name="action_print_survey" string="Print Survey" type="object" icon="gtk-print" context="{'survey_id': survey_id, 'response_id': [id], 'response_no':0}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button name="%(mail.action_email_compose_message_wizard)d" string="Send Reminder Email" icon="terp-mail-message-new" type="action" states="waiting_answer"/>
|
||||
<field name="state"/>
|
||||
<button string="Send Request" name="survey_req_waiting_answer" states="draft" type="object" icon="gtk-yes" />
|
||||
<button string="Done" name="survey_req_done" states="waiting_answer" type="object" icon="gtk-jump-to" />
|
||||
<button string="Done" name="survey_req_done" states="new,skip" type="object" icon="gtk-jump-to" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -347,13 +345,15 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Appraisal">
|
||||
<field name="date_deadline"/>
|
||||
<filter icon="terp-gtk-go-back-rtl" string="To Do" name="todo" domain="[('state','=','waiting_answer')]"/>
|
||||
<field name="user_to_review_id"/>
|
||||
<field name="user_id" string="Interviewer"/>
|
||||
<field name="user_id"/>
|
||||
<filter string="Interviews to do" name="todo_interviewer" domain="['&', ('state','=','done'), ('user_id','=',uid)]"/>
|
||||
<filter string="Responses to do" name="todo_employee" domain="['&', ('state','in',['new','skip']), ('user_to_review_id.user_id','=',uid)]"/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Interviewer" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Survey" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'survey_id'}"/>
|
||||
<filter string="Status" name="group_state" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Interviewer" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Epmloyee" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Survey" context="{'group_by':'survey_id'}"/>
|
||||
<filter string="Status" context="{'group_by':'state'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -364,7 +364,7 @@
|
||||
<field name="model">hr.evaluation.interview</field>
|
||||
<field name="arch" type="xml">
|
||||
<calendar string="Interview Request" color="user_to_review_id" date_start="date_deadline">
|
||||
<field name="request_id"/>
|
||||
<field name="response_id"/>
|
||||
</calendar>
|
||||
</field>
|
||||
</record>
|
||||
@@ -375,7 +375,7 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" eval="False"/>
|
||||
<field name="domain">[('is_evaluation' ,'=', True)]</field>
|
||||
<field name="context">{'default_is_evaluation': True, "search_default_todo":1,"search_default_user_id":uid}</field>
|
||||
<field name="context">{"search_default_todo_employee":1, "search_default_todo_interviewer":1}</field>
|
||||
<field name="search_view_id" ref="view_hr_evaluation_interview_search"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
|
||||
@@ -32,7 +32,7 @@ class hr_evaluation_report(osv.osv):
|
||||
'overpass_delay':fields.float('Overpassed Deadline', digits=(16,2), readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'deadline': fields.date("Deadline", readonly=True),
|
||||
'request_id': fields.many2one('survey.request', 'Request_id', readonly=True),
|
||||
'response_id': fields.many2one('survey.response', 'Response_id', readonly=True),
|
||||
'closed': fields.date("closed", readonly=True),
|
||||
'year': fields.char('Year', size=4, readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||
@@ -66,7 +66,7 @@ class hr_evaluation_report(osv.osv):
|
||||
date_trunc('day',s.create_date) as create_date,
|
||||
to_char(s.create_date, 'YYYY-MM-DD') as day,
|
||||
s.employee_id,
|
||||
l.request_id,
|
||||
l.response_id,
|
||||
s.plan_id,
|
||||
s.rating,
|
||||
s.date as deadline,
|
||||
@@ -91,7 +91,7 @@ class hr_evaluation_report(osv.osv):
|
||||
s.employee_id,
|
||||
s.date,
|
||||
s.date_close,
|
||||
l.request_id,
|
||||
l.response_id,
|
||||
s.rating,
|
||||
s.plan_id
|
||||
)
|
||||
|
||||
@@ -8,7 +8,6 @@ access_hr_evaluation_interview_employee,hr.evaluation.interview.employee,model_h
|
||||
access_hr_evaluation_report,hr.evaluation.report,model_hr_evaluation_report,base.group_hr_manager,1,1,1,1
|
||||
access_survey_type_hr_manager,survey.type,survey.model_survey_type,base.group_hr_manager,1,1,1,1
|
||||
access_survey_hr_manager,survey.hr.manager,survey.model_survey,base.group_hr_manager,1,1,1,1
|
||||
access_survey_history_manager,survey.history,survey.model_survey_history,base.group_hr_manager,1,1,1,1
|
||||
access_survey_question_hr_manager,survey.question,survey.model_survey_question,base.group_hr_manager,1,1,1,1
|
||||
access_survey_question_column_heading_hr_manager,survey.question.column.heading,survey.model_survey_question_column_heading,base.group_hr_manager,1,1,1,1
|
||||
access_survey_answer_hr_manager,survey.answer,survey.model_survey_answer,base.group_hr_manager,1,1,1,1
|
||||
@@ -16,21 +15,17 @@ access_survey_response_hr_manager,survey.response,survey.model_survey_response,b
|
||||
access_survey_response_line_hr_manager,survey.response.line,survey.model_survey_response_line,base.group_hr_manager,1,1,1,1
|
||||
access_survey_tbl_column_heading_hr_manager,survey.tbl.column.heading,survey.model_survey_tbl_column_heading,base.group_hr_manager,1,1,1,1
|
||||
access_survey_response_answer_hr_manager,survey.response.answer,survey.model_survey_response_answer,base.group_hr_manager,1,1,1,1
|
||||
access_survey_request_hr_manager,survey.request,survey.model_survey_request,base.group_hr_manager,1,1,1,1
|
||||
access_survey_answer_hr_user,survey.answer.hr.user,survey.model_survey_answer,base.group_hr_user,1,1,1,0
|
||||
access_survey_response_answer_hr_user,survey.response.answer.hr.user,survey.model_survey_response_answer,base.group_hr_user,1,1,1,0
|
||||
access_survey_type_hr_user,survey.type.hr.user,survey.model_survey_type,base.group_hr_user,1,1,1,0
|
||||
access_survey_question_hr_user,survey.question.hr.user,survey.model_survey_question,base.group_hr_user,1,1,1,0
|
||||
access_survey_page_hr_user,survey.page.hr.user,survey.model_survey_page,base.group_hr_user,1,1,1,1
|
||||
access_survey_response_hr_user,survey.response.hr.user,survey.model_survey_response,base.group_hr_user,1,1,1,0
|
||||
access_survey_history_hr_user,survey.history.hr.user,survey.model_survey_history,base.group_hr_user,1,1,1,0
|
||||
access_survey_request_hr_user,survey.request.hr.user,survey.model_survey_request,base.group_hr_user,1,1,1,0
|
||||
access_survey_question_column_heading_hr_user,survey.question.column.heading.hr.user,survey.model_survey_question_column_heading,base.group_hr_user,1,1,1,0
|
||||
access_survey_response_line_hr_user,survey.response.line.hr.user,survey.model_survey_response_line,base.group_hr_user,1,1,1,0
|
||||
access_survey_tbl_column_heading_hr_user,survey.tbl.column.heading.hr.user,survey.model_survey_tbl_column_heading,base.group_hr_user,1,1,1,0
|
||||
access_base_calendar_attendee_survey_user,base.calendar.calendar.attendee.survey.user,base_calendar.model_calendar_attendee,base.group_survey_user,1,1,1,0
|
||||
access_base_calendar_attendee_tool_user,base.calendar.calendar.attendee.tool.user,base_calendar.model_calendar_attendee,base.group_tool_user,1,1,1,0
|
||||
access_survey_request_hr_employee,survey.request.hr.employee,survey.model_survey_request,base.group_user,1,1,1,0
|
||||
access_survey_hr_employee,survey.hr.employee,survey.model_survey,base.group_user,1,1,0,0
|
||||
access_survey_page_hr_employee,survey.page.hr.employee,survey.model_survey_page,base.group_user,1,0,0,0
|
||||
access_survey_answer_hr_employee,survey.answer.employee,survey.model_survey_answer,base.group_user,1,0,0,0
|
||||
|
||||
|
@@ -83,7 +83,7 @@
|
||||
string="Schedule Meeting" help="Schedule interview with this applicant"/>
|
||||
<button name="%(survey.action_view_survey_question_message)d" type="action"
|
||||
string="Start Interview" help="Answer related job question"
|
||||
context="{'survey_id': survey, 'response_id': [response], 'response_no':0 ,'active' : response, 'object' : 'hr.applicant'}"
|
||||
context="{'survey_id': survey, 'response_id': [response_id], 'response_no':0 ,'active' : response, 'object' : 'hr.applicant'}"
|
||||
attrs="{'invisible':[('survey','=',False)]}"/>
|
||||
<button name="action_print_survey" type="object"
|
||||
string="Print Interview" help="Print interview report"
|
||||
@@ -120,7 +120,7 @@
|
||||
</group>
|
||||
<group string="Job">
|
||||
<field name="survey" invisible="1"/>
|
||||
<field name="response" invisible="1"/>
|
||||
<field name="response_id" invisible="1"/>
|
||||
<field name="job_id" on_change="onchange_job(job_id)"/>
|
||||
<field name="department_id" on_change="onchange_department_id(department_id)"/>
|
||||
<label for="availability"/>
|
||||
|
||||
@@ -198,7 +198,7 @@ class survey_browse_response(report_rml):
|
||||
|
||||
surv_resp_line_obj = pooler.get_pool(cr.dbname).get('survey.response.line')
|
||||
surv_obj = pooler.get_pool(cr.dbname).get('survey')
|
||||
|
||||
|
||||
for response in surv_resp_obj.browse(cr, uid, response_id):
|
||||
for survey in surv_obj.browse(cr, uid, [response.survey_id.id]):
|
||||
tbl_width = float(_tbl_widths.replace('cm', ''))
|
||||
@@ -210,7 +210,7 @@ class survey_browse_response(report_rml):
|
||||
<td><para style="terp_default_9">""" + to_xml(rml_obj.formatLang(time.strftime("%Y-%m-%d %H:%M:%S"),date_time=True)) + """</para></td>
|
||||
<td><para style="terp_default_9"></para></td>
|
||||
<td><para style="terp_default_9_Bold">Answered by : </para></td>
|
||||
<td><para style="terp_default_9">""" + to_xml(response.user_id.login or '') + """</para></td>
|
||||
<td><para style="terp_default_9">""" + to_xml(response.partner_id.name or '') + """</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_9"></para></td>
|
||||
|
||||
@@ -56,7 +56,6 @@ class survey(osv.osv):
|
||||
'tot_start_survey': fields.integer("Total Started Survey", readonly=1),
|
||||
'tot_comp_survey': fields.integer("Total Completed Survey", readonly=1),
|
||||
'note': fields.text('Description', size=128),
|
||||
'partner_id': fields.many2many('res.partner', 'survey_partner_rel', 'sid', 'partner_id', 'Partners'),
|
||||
'send_response': fields.boolean('Email Notification on Answer'),
|
||||
'type': fields.many2one('survey.type', 'Type'),
|
||||
'color': fields.integer('Color Index'),
|
||||
@@ -616,6 +615,7 @@ class survey_response(osv.osv):
|
||||
'email': fields.char("Email", size=64, readonly=1),
|
||||
}
|
||||
_defaults = {
|
||||
'date_create': datetime.now(),
|
||||
'state': "new",
|
||||
'response_type': "manually",
|
||||
}
|
||||
@@ -691,12 +691,4 @@ class survey_response_answer(osv.osv):
|
||||
survey_response_answer()
|
||||
|
||||
|
||||
class res_partner(osv.osv):
|
||||
_inherit = "res.partner"
|
||||
_name = "res.partner"
|
||||
_columns = {
|
||||
'survey_id': fields.many2many('survey', 'survey_partner_rel', 'partner_id', 'sid', 'Groups'),
|
||||
}
|
||||
res_partner()
|
||||
|
||||
# vim: exp and tab: smartindent: tabstop=4: softtabstop=4: shiftwidth=4:
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
<field name="color">5</field>
|
||||
<field name="tot_comp_survey">1</field>
|
||||
<field name="tot_start_survey">1</field>
|
||||
<field name="response_user">5</field>
|
||||
<field name="date_open" eval="time.strftime('%Y-%m-%d %H:%M:%S')"/>
|
||||
</record>
|
||||
|
||||
@@ -165,7 +164,6 @@
|
||||
<field name="state">open</field>
|
||||
<field name="tot_comp_survey">1</field>
|
||||
<field name="tot_start_survey">1</field>
|
||||
<field name="response_user">5</field>
|
||||
<field name="date_open" eval="time.strftime('%Y-%m-%d %H:%M:%S')"/>
|
||||
</record>
|
||||
|
||||
@@ -632,7 +630,6 @@
|
||||
<field name="state">open</field>
|
||||
<field name="tot_comp_survey">1</field>
|
||||
<field name="tot_start_survey">1</field>
|
||||
<field name="response_user">5</field>
|
||||
<field name="date_open" eval="time.strftime('%Y-%m-%d %H:%M:%S')"/>
|
||||
</record>
|
||||
|
||||
@@ -1407,7 +1404,6 @@
|
||||
<field name="max_response_limit">20</field>
|
||||
<field name="type" ref="survey_type2"/>
|
||||
<field name="state">open</field>
|
||||
<field name="response_user">5</field>
|
||||
</record>
|
||||
</data>
|
||||
<data>
|
||||
@@ -2251,13 +2247,10 @@
|
||||
<record id="survey_0_Community" model="survey">
|
||||
<field name="title">Community Survey</field>
|
||||
<field name="note">Please take a few minutes to complete this survey on the quality of service we provide. We welcome your feedback and appreciate your honesty. With your help, we hope to strengthen the bond between our clients.</field>
|
||||
<field eval="6" name="response_user"/>
|
||||
<field name="state">open</field>
|
||||
<field name="responsible_id" ref="base.user_root"/>
|
||||
<field eval="1" name="send_response"/>
|
||||
<field eval="[(6,0,[])]" name="users"/>
|
||||
<field name="type" ref="survey_type3"/>
|
||||
<field name="response_user">5</field>
|
||||
<field name="max_response_limit">20</field>
|
||||
</record>
|
||||
</data>
|
||||
@@ -2919,7 +2912,7 @@
|
||||
<field name="date_create" eval="time.strftime('%Y-%m-%d %H:%M:%S')+'.603599'"/>
|
||||
<field name="state">done</field>
|
||||
<field name="survey_id" ref="survey.survey_partner_feedback"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="partner_id" ref="base.res_partner_1"/>
|
||||
<field name="response_type">link</field>
|
||||
</record>
|
||||
</data>
|
||||
@@ -2928,7 +2921,7 @@
|
||||
<field name="date_create" eval="time.strftime('%Y-%m-%d %H:%M:%S')+'.247905'"/>
|
||||
<field name="state">done</field>
|
||||
<field name="survey_id" ref="survey.survey_odoo_feedback"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="partner_id" ref="base.res_partner_1"/>
|
||||
<field name="response_type">link</field>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
@@ -315,7 +315,6 @@
|
||||
<br/>
|
||||
<ul>
|
||||
<t t-set="open" t-value="record.state.raw_value === 'open' or record.state.raw_value === 'restricted'"/>
|
||||
<li t-if="widget.view.is_action_enabled('edit')"><a type="edit">Configuration</a></li>
|
||||
<li t-if="widget.view.is_action_enabled('edit')"><a name="edit_survey" string="Edit Survey" type="object" context="{'active':True,'edit' : True}">Edit Survey</a></li>
|
||||
<li t-if="widget.view.is_action_enabled('edit')"><a t-att-style="!open?'color:#aaaaaa;':''" name="action_survey_sent" type="object">Send invite by email</a></li>
|
||||
<li><a t-att-style="!open?'color:#aaaaaa;':''" name="fill_survey" type="object">Answer Survey</a></li>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<field name="model_id" ref="model_survey"/>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html"><![CDATA[
|
||||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
|
||||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); ">
|
||||
<p>Hello,</p>
|
||||
<p>
|
||||
Would you please spent some of your time to fill-in our survey:
|
||||
|
||||
@@ -37,10 +37,10 @@ class survey_print_answer(osv.osv_memory):
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'orientation': lambda *a:'vertical',
|
||||
'paper_size': lambda *a:'letter',
|
||||
'page_number': lambda *a: 0,
|
||||
'without_pagebreak': lambda *a: 0
|
||||
'orientation': 'vertical',
|
||||
'paper_size': 'letter',
|
||||
'page_number': 0,
|
||||
'without_pagebreak': 0
|
||||
}
|
||||
|
||||
def action_next(self, cr, uid, ids, context=None):
|
||||
|
||||
Reference in New Issue
Block a user