summaryrefslogtreecommitdiff
path: root/addons/hr_gamification
diff options
context:
space:
mode:
authorKeyur Gajjar <kga@odoo.com>2015-12-14 19:02:31 +0530
committerYannick Tivisse <yti@odoo.com>2016-03-21 14:02:10 +0100
commit82e35bce6c4fa2e6dca98309f7a9483a9a719eb9 (patch)
treebb5773e41a238f252b5a0321a6e9b509350a3805 /addons/hr_gamification
parentbea7b198621a76f3f29853fc8725e9821ff375cc (diff)
[FIX] gamification: several layout issues
1/ ISSUES WITH BADGES: Go to menu Employees > Badges > Select any Badge from kanban View. Click on "GRANT THIS BADGE" button. - When you grant a badge, the description field is not at the right place. It should be below the employee field - Badges Form View: "Granted Employees" should be a stat button with a counter - Badges form view is broken, field label/values are not at right place 2/ ISSUES WITH CHALLENGES: Go to menu Employees > Challenges Challenges Kanban View - Image Avatars are too big, make it smaller. - Challenges Form View > Advanced Options : fields Report frequency, Report Template and Send a Copy to are ugly
Diffstat (limited to 'addons/hr_gamification')
-rw-r--r--addons/hr_gamification/models/gamification.py10
-rw-r--r--addons/hr_gamification/views/gamification.xml4
2 files changed, 13 insertions, 1 deletions
diff --git a/addons/hr_gamification/models/gamification.py b/addons/hr_gamification/models/gamification.py
index 6a483837dfa..034f4e44d85 100644
--- a/addons/hr_gamification/models/gamification.py
+++ b/addons/hr_gamification/models/gamification.py
@@ -49,6 +49,16 @@ class gamification_badge(osv.Model):
'domain': [('id', 'in', employee_ids)]
}
+ def _get_granted_employees_count(self, cr, uid, ids, field_name, arg, context=None):
+ res = {}
+ for badge in self.browse(cr, uid, ids, context=context):
+ res[badge.id] = self.pool.get('gamification.badge.user').search_count(cr, uid, [('badge_id', '=', badge.id), ('employee_id', '!=', False)], context=context)
+ return res
+
+ _columns = {
+ 'granted_employees_count': fields.function(_get_granted_employees_count, type="integer")
+ }
+
class hr_employee(osv.osv):
_name = "hr.employee"
diff --git a/addons/hr_gamification/views/gamification.xml b/addons/hr_gamification/views/gamification.xml
index ed4eb263e1e..7bdfd2134bf 100644
--- a/addons/hr_gamification/views/gamification.xml
+++ b/addons/hr_gamification/views/gamification.xml
@@ -8,7 +8,9 @@
<field name="inherit_id" ref="gamification.badge_form_view"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
- <button string="Granted Employees" type="object" name="get_granted_employees" attrs="{'invisible': [('stat_count','=',0)]}" />
+ <button class="oe_stat_button" type="object" name="get_granted_employees" attrs="{'invisible': [('stat_count','=',0)]}" icon="fa-user">
+ <field name="granted_employees_count" string="Granted" widget="statinfo"/>
+ </button>
</div>
</field>
</record>