From aa9b855cb8f053dcf8635bb005295642e4409d80 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 22 Feb 2013 14:40:24 +0100 Subject: [PATCH] [IMP] gamification: and draft state and readonly if not draft bzr revid: mat@openerp.com-20130222134024-kbdgivricb2zwxgo --- addons/gamification/goal.py | 4 +++- addons/gamification/view/goal.xml | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/addons/gamification/goal.py b/addons/gamification/goal.py index 8861a5b6bb8..5016f81a17f 100644 --- a/addons/gamification/goal.py +++ b/addons/gamification/goal.py @@ -137,6 +137,7 @@ class gamification_goal(osv.Model): type='float', string='Completeness'), 'state': fields.selection([ + ('draft', 'Draft'), ('inprogress', 'In progress'), ('inprogress_update', 'In progress (to update)'), ('reached', 'Reached'), @@ -158,7 +159,7 @@ class gamification_goal(osv.Model): _defaults = { 'current': 0, - 'state': 'inprogress', + 'state': 'draft', 'start_date': fields.date.today, 'last_update': fields.date.today, } @@ -259,6 +260,7 @@ class gamification_goal(osv.Model): 'planline_id':planline_id, 'user_id':user_id, 'target_goal':planline.target_goal, + 'state':'inprogress', } if start_date: diff --git a/addons/gamification/view/goal.xml b/addons/gamification/view/goal.xml index b871fd9cbf1..926d02f9c71 100644 --- a/addons/gamification/view/goal.xml +++ b/addons/gamification/view/goal.xml @@ -49,13 +49,13 @@ - - - + + + - - + + - +