diff options
| author | Gery Debongnie <ged@openerp.com> | 2014-04-14 15:43:32 +0200 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2014-04-14 15:43:32 +0200 |
| commit | 9950bb8f74ecc5f6af4eb9a79df94c73c0fea69a (patch) | |
| tree | b24ac56dfe7bc7f2bd5ca0842754c6b91ebe3085 | |
| parent | 0a3987b6c91960f572a2a5b0a848146c06a8d1f2 (diff) | |
[FIX] remove an useless computation in gamification.py and improves the text of the stat button displayed in challenges form view (addon gamification)
bzr revid: ged@openerp.com-20140414134332-h4gn61fu1ly9tbye
| -rw-r--r-- | addons/gamification/models/challenge.py | 11 | ||||
| -rw-r--r-- | addons/gamification/views/challenge.xml | 2 |
2 files changed, 1 insertions, 12 deletions
diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py index 11b5f787bdd..06d0c44baac 100644 --- a/addons/gamification/models/challenge.py +++ b/addons/gamification/models/challenge.py @@ -114,15 +114,6 @@ class gamification_challenge(osv.Model): return self.pool.get('ir.model.data').get_object_reference(cr, uid, 'gamification', 'simple_report_template')[1] except ValueError: return False - - def _count_goals(self, cr, uid, ids, field_name, arg, context=None): - res = {} - try: - for goals in self.browse(cr, uid, ids, context=context): - res[goals.id] = len(goals.goals_ids) - except: - pass - return res _order = 'end_date, start_date, name, id' _columns = { @@ -200,8 +191,6 @@ class gamification_challenge(osv.Model): 'category': fields.selection(lambda s, *a, **k: s._get_categories(*a, **k), string="Appears in", help="Define the visibility of the challenge through menus", required=True), - 'goals_ids': fields.one2many('gamification.goal', 'challenge_id', 'Related Goals'), - 'goals_count': fields.function(_count_goals, type='integer', string='Related Goals') } _defaults = { diff --git a/addons/gamification/views/challenge.xml b/addons/gamification/views/challenge.xml index 9683557a14c..e427780677b 100644 --- a/addons/gamification/views/challenge.xml +++ b/addons/gamification/views/challenge.xml @@ -58,7 +58,7 @@ class="oe_stat_button" icon="fa-gift" attrs="{'invisible': [('state','=','draft')]}"> - <field name="goals_count" widget="statinfo" string="Goals" help="Related Goals"/> + <div>Related<br/>Goals</div> </button> </div> <group> |
