[ADD] kanban view for goals in employee view

bzr revid: mat@openerp.com-20130305133236-3ys5frjawpchn9ef
This commit is contained in:
Martin Trigaux 2013-03-05 14:32:36 +01:00
parent d6f0f18704
commit 13ee12041c
3 changed files with 22 additions and 1 deletions

View File

@ -142,8 +142,12 @@
<div class="oe_kanban_content">
<h4><field name="type_id"/></h4>
<div class="oe_kanban_project_list">
<t t-esc="Math.round(record.current.raw_value)"/>/<t t-esc="Math.round(record.target_goal.raw_value)"/>
<p>
<t t-esc="Math.round(record.current.raw_value)"/>/<t t-esc="Math.round(record.target_goal.raw_value)"/>
&#10216;<t t-esc="Math.round(record.completeness.raw_value)"/>%%&#10217;
<br/>
<small>End: <field name="end_date" /></small>
</p>
</div>
</div>
</div>

View File

@ -103,9 +103,19 @@ hr_evaluation_plan_phase()
class hr_employee(osv.osv):
_name = "hr.employee"
_inherit="hr.employee"
def _get_employee_goals(self, cr, uid, ids, field_name, arg, context=None):
"""Return the list of goals assigned to the employee"""
res = {}
for employee in self.browse(cr, uid, ids, context=context):
res[employee.id] = self.pool.get('gamification.goal').search(cr,uid,[('user_id','=',employee.user_id.id)], context=context)
return res
_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)."),
'goal_ids': fields.function(_get_employee_goals, type="one2many", obj='gamification.goal', string="Employee Goals")
}
def run_employee_evaluation(self, cr, uid, automatic=False, use_new_cursor=False, context=None):
now = parser.parse(datetime.now().strftime('%Y-%m-%d'))
@ -125,6 +135,8 @@ 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"

View File

@ -147,6 +147,11 @@
<xpath expr="//div[@name='button_box']" position="inside">
<button name="%(act_hr_employee_2_hr__evaluation_interview)d" string="Appraisal Interviews" type="action"/>
</xpath>
<xpath expr="//page[@string='Public Information']" position="after">
<page string="Goals">
<field name="goal_ids" widget="many2many_kanban" />
</page>
</xpath>
</field>
</record>