From e03393fcc57149ef12f7c385b99e088da3275fad Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 7 Mar 2013 12:15:57 +0100 Subject: [PATCH] [IMP] sort goals by date bzr revid: mat@openerp.com-20130307111557-r4lbtzdeicf7joo6 --- addons/gamification/goal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/gamification/goal.py b/addons/gamification/goal.py index beceb3470f8..65f69c12130 100644 --- a/addons/gamification/goal.py +++ b/addons/gamification/goal.py @@ -35,7 +35,6 @@ class gamification_goal_type(osv.Model): """ _name = 'gamification.goal.type' _description = 'Gamification goal type' - _order = "sequence" _columns = { 'name': fields.char('Type Name', required=True, translate=True), @@ -103,7 +102,7 @@ class gamification_goal(osv.Model): res[goal.id] = min(100, round(100.0 * goal.current / goal.target_goal, 2)) else: res[goal.id] = 0.0 - + return res def on_change_type_id(self, cr, uid, ids, type_id=False, context=None): @@ -166,6 +165,7 @@ class gamification_goal(osv.Model): 'state': 'draft', 'start_date': fields.date.today, } + _order = 'last_update desc, end_date, type_id' def update(self, cr, uid, ids, context=None):