[ADD] gamification: refresh button for manual goal

bzr revid: mat@openerp.com-20130226153247-ak48q3dooyc71doi
This commit is contained in:
Martin Trigaux 2013-02-26 16:32:47 +01:00
parent 240ed326b2
commit 6cc39b566a
2 changed files with 5 additions and 1 deletions

View File

@ -273,8 +273,9 @@ class gamification_goal(osv.Model):
def write(self, cr, uid, ids, vals, context=None):
"""Overwrite the write method to update the last_update field to today"""
for goal in self.browse(cr, uid, ids, vals):
vals['last_update'] = fields.date.today()
vals['last_update'] = fields.date.today()
write_res = super(gamification_goal, self).write(cr, uid, ids, vals, context=context)
return write_res

View File

@ -47,6 +47,9 @@
<field name="state" widget="statusbar" statusbar_visible="inprogress" />
</header>
<sheet>
<div class="oe_right oe_button_box" attrs="{'invisible':[('computation_mode','!=', 'manually')]}">
<button name="write" type="object" string="Refresh/The value is up to date" help="Indicate that the current value of the manual goal is still correct and avoid reminders"/>
</div>
<group>
<group string="Reference">
<field name="type_id" on_change="on_change_type_id(type_id)" attrs="{'readonly':[('state','!=','draft')]}"/>