[FIX] correct goal id action buttons
bzr revid: mat@openerp.com-20130327111636-dbg162rd4pvgok0k
This commit is contained in:
parent
b08a2f2bbc
commit
c7fc486809
|
@ -31,6 +31,7 @@ class res_users_gamification_group(osv.Model):
|
|||
for plan in plan_obj.browse(cr, uid, plan_ids, context=context):
|
||||
# serialize goals info to be able to use it in javascript
|
||||
serialized_goals_info = {
|
||||
'id': plan.id,
|
||||
'name': plan.name,
|
||||
'visibility_mode': plan.visibility_mode,
|
||||
}
|
||||
|
@ -64,6 +65,8 @@ class res_users_gamification_group(osv.Model):
|
|||
'current': goal[1].current,
|
||||
'target_goal': goal[1].target_goal,
|
||||
})
|
||||
if uid == goal[1].user_id.id:
|
||||
vals['own_goal_id'] = goal[1].id
|
||||
serialized_goals_info['planlines'].append(vals)
|
||||
|
||||
else:
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<div t-foreach="widget.goals_info.info" t-as="plan">
|
||||
<em><a class="oe_update_plan" rol="button" t-attf-id="{plan.id}">refresh</a></em>
|
||||
<h3><t t-esc="plan.name" /></h3>
|
||||
|
||||
<t t-if="plan.visibility_mode == 'progressbar'">
|
||||
<ul class="oe_goals_list">
|
||||
<li t-foreach="plan.goals" t-as="goal">
|
||||
|
@ -43,7 +44,7 @@
|
|||
<th colspan="4" t-attf-title="#{planline.type_description ? planline.type_description : ''}">
|
||||
<t t-esc="planline.type_name"/>
|
||||
<t t-if="planline.type_computation_mode == 'manually' or planline.type_action">
|
||||
<a class="oe_goal_action" t-att-id="goal.id">modify</a>
|
||||
<a class="oe_goal_action" t-att-id="planline.own_goal_id">modify</a>
|
||||
</t>
|
||||
</th>
|
||||
</tr>
|
||||
|
@ -55,7 +56,7 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="planline.goals" t-as="goal" t-attf-class="#{goal.completness >= 100 ? 'oe_bold' : ''}">
|
||||
<tr t-foreach="planline.goals" t-as="goal" t-attf-class="#{goal.id == planline.own_goal_id ? 'oe_bold' : ''}">
|
||||
<th><t t-esc="goal.rank" /></th>
|
||||
<td><t t-esc="goal.user_name" /></td>
|
||||
<td><progress t-att-value="goal.completeness" max="100" /></td>
|
||||
|
|
Loading…
Reference in New Issue