[IMP] better kanban display

bzr revid: mat@openerp.com-20130307134447-kpsqvqbpc0jdk3y3
This commit is contained in:
Martin Trigaux 2013-03-07 14:44:47 +01:00
parent d53a53d315
commit 1b01215929
4 changed files with 15 additions and 6 deletions

View File

@ -152,12 +152,16 @@ class gamification_goal(osv.Model):
help="The number of days after which the user assigned to a manual goal will be reminded. Never reminded if no value is specified."),
'last_update' : fields.date('Last Update',
help="In case of manual goal, reminders are sent if the goal as not been updated for a while (defined in goal plan). Ignored in case of non-manual goal or goal not linked to a plan."),
'type_description': fields.related('type_id','description',
type='char',
string='Type Description'),
'type_unit': fields.related('type_id','unit',
'type_unit': fields.related('type_id', 'unit',
type='char',
string='Type Description'),
'type_condition': fields.related('type_id', 'condition',
type='char',
string='Type Condition'),
}
_defaults = {

View File

@ -136,10 +136,14 @@
<field name="completeness"/>
<field name="state"/>
<field name="target_goal"/>
<field name="type_condition"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click oe_kanban_goal oe_kanban_color_#{record.state.raw_value}">
<div class="oe_kanban_content">
<div class="oe_kanban_left">
<img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" width="24" height="24" />
</div>
<h4><field name="type_id"/></h4>
<t t-if="record.type_description.value">
<em><field name="type_description"/></em>
@ -148,7 +152,9 @@
<p>
<big><t t-esc="Math.round(record.current.raw_value)"/>/<t t-esc="Math.round(record.target_goal.raw_value)"/></big>
<t t-if="record.type_unit.value"><field name="type_unit"/></t>
&#10216;<t t-esc="Math.round(record.completeness.raw_value)"/>%%&#10217;
<t t-if="record.type_condition.raw_value == 'higher'">
&#10216;<t t-esc="Math.round(record.completeness.raw_value)"/>%%&#10217;
</t>
<br/>
<small>End: <field name="end_date" /></small>
</p>

View File

@ -182,8 +182,7 @@ class gamification_goal_plan(osv.Model):
def write(self, cr, uid, ids, vals, context=None):
"""Overwrite the write method to add the user of groups"""
if context is None:
context = {}
context = context or {}
if not ids:
return True
@ -413,7 +412,7 @@ class gamification_goal_plan(osv.Model):
:param plan: the plan object that need to be reported
:param list(res.users) users: the list of users that are concerned by
the report. If False, will send the report to every user concerned
(goal users and group that recieves a copy). Only used for plan with
(goal users and group that receive a copy). Only used for plan with
a visibility mode set to 'personal'.
:param list(int) goal_ids: the list of goal ids linked to the plan for
the report. If not specified, use the goals for the current plan

View File

@ -100,7 +100,7 @@
Select a group that will receive a copy of the reports.
</p>
<p attrs="{'invisible': [('report_message_group_id','=',False)]}">
A copy of the report that user recieve will be sent to this group.
A copy of the report will be sent to this group.
</p>
</group>
</div>