[IMP] better views

bzr revid: mat@openerp.com-20130411132438-x38ngml9sdi0uwb2
This commit is contained in:
Martin Trigaux 2013-04-11 15:24:38 +02:00
parent 4bcea683e2
commit d4ccdb46de
3 changed files with 9 additions and 9 deletions

View File

@ -27,9 +27,9 @@
<form string="Grant Badge To" version="7.0">
Who would you like to reward?
<group>
<field name="user_id" />
<field name="user_id" nolabel="1" />
<field name="badge_id" invisible="1"/>
<field name="comment" placeholder="Describe what they did and why it matters" />
<field name="comment" nolabel="1" placeholder="Describe what they did and why it matters" />
</group>
<footer>
<button string="Grant Badge" type="object" name="action_grant_badge" class="oe_highlight" /> or

View File

@ -45,9 +45,9 @@ class hr_gamification_badge_user(osv.Model):
]
class hr_gamification_badge(osv.Model):
class gamification_badge(osv.Model):
_name = 'gamification.badge'
_inherit = ['gamification.badge', 'mail.thread']
_inherit = ['gamification.badge']
def message_post(self, cr, uid, thread_id, context=None, **kwargs):
"""Overwrite the message_post method to send the badge to the employee"""
@ -58,7 +58,7 @@ class hr_gamification_badge(osv.Model):
if badge_user.employee_id:
return self.pool.get('hr.employee').message_post(cr, uid,
badge_user.employee_id.id, context=context, **kwargs)
return super(hr_gamification_badge, self).message_post(cr, uid, thread_id, context=context, **kwargs)
return super(gamification_badge, self).message_post(cr, uid, thread_id, context=context, **kwargs)
class hr_grant_badge_wizard(osv.TransientModel):

View File

@ -11,9 +11,9 @@
<form string="Grant Badge To" version="7.0">
Who would you like to reward?
<group>
<field name="employee_id" />
<field name="employee_id" nolabel="1" domain="[('user_id', '!=', False)]" />
<field name="badge_id" invisible="1"/>
<field name="comment" placeholder="Describe what they did and why it matters" />
<field name="comment" nolabel="1" placeholder="Describe what they did and why it matters" />
</group>
<footer>
<button string="Grant Badge" type="object" name="action_grant_badge" class="oe_highlight" /> or
@ -34,8 +34,8 @@
What are you thank for?
<group>
<field name="employee_id" invisible="1" />
<field name="badge_id" />
<field name="comment" placeholder="Describe what they did and why it matters" />
<field name="badge_id" nolabel="1" />
<field name="comment" nolabel="1" placeholder="Describe what they did and why it matters" />
</group>
<footer>
<button string="Reward Employee" type="object" name="action_grant_badge" class="oe_highlight" /> or