diff options
| author | Mustufa Rangwala <mra@mra-laptop> | 2010-07-02 20:07:06 +0530 |
|---|---|---|
| committer | Mustufa Rangwala <mra@mra-laptop> | 2010-07-02 20:07:06 +0530 |
| commit | 26f266785ec39b4d58b481a203e9e86a0ff30892 (patch) | |
| tree | e501eff7e7e3c37ce34562ba04b3b1ca3fd8aef7 /addons/project/wizard/project_task_delegate.py | |
| parent | 5477d0de864d9919dc8578a8b3bea172a27a1618 (diff) | |
[IMP] clean project_* code (DHS)
bzr revid: mra@mra-laptop-20100702143706-k5zeko7e9n7ikvk1
Diffstat (limited to 'addons/project/wizard/project_task_delegate.py')
| -rw-r--r-- | addons/project/wizard/project_task_delegate.py | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/addons/project/wizard/project_task_delegate.py b/addons/project/wizard/project_task_delegate.py index adfddcd8fd9..30fc02f9ca3 100644 --- a/addons/project/wizard/project_task_delegate.py +++ b/addons/project/wizard/project_task_delegate.py @@ -33,12 +33,11 @@ class project_task_delegate(osv.osv_memory): 'new_task_description': fields.text('New Task Description', help="Reinclude the description of the task in the task of the user"), 'planned_hours': fields.float('Planned Hours', help="Estimated time to close this task by the delegated user"), 'planned_hours_me': fields.float('Hours to Validate', required=True, help="Estimated time for you to validate the work done by the user to whom you delegate this task"), - 'state': fields.selection([('pending','Pending'), - ('done','Done'), - ],'Validation State', required=True, help="New state of your own task. Pending will be reopened automatically when the delegated task is closed"), - } + 'state': fields.selection([('pending','Pending'), ('done','Done'), ], 'Validation State', required=True, help="New state of your own task. Pending will be reopened automatically when the delegated task is closed"), } - def _get_name(self, cr, uid, context={}): + def _get_name(self, cr, uid, context=None): + if context is None: + context = {} if 'active_id' in context: task = self.pool.get('project.task').browse(cr, uid, context['active_id']) if task.name.startswith(_('CHECK: ')): @@ -48,13 +47,17 @@ class project_task_delegate(osv.osv_memory): return newname return '' - def _get_plan_hour(self, cr, uid, context={}): + def _get_plan_hour(self, cr, uid, context=None): + if context is None: + context = {} if 'active_id' in context: task = self.pool.get('project.task').browse(cr, uid, context['active_id']) return task.remaining_hours return 0.0 - def _get_prefix(self, cr, uid, context={}): + def _get_prefix(self, cr, uid, context=None): + if context is None: + context = {} if 'active_id' in context: task = self.pool.get('project.task').browse(cr, uid, context['active_id']) if task.name.startswith(_('CHECK: ')): @@ -64,7 +67,9 @@ class project_task_delegate(osv.osv_memory): return _('CHECK: ')+ newname return '' - def _get_new_desc(self, cr, uid, context={}): + def _get_new_desc(self, cr, uid, context=None): + if context is None: + context = {} if 'active_id' in context: task = self.pool.get('project.task').browse(cr, uid, context['active_id']) return task.description @@ -79,7 +84,9 @@ class project_task_delegate(osv.osv_memory): 'state': 'pending', } - def validate(self, cr, uid, ids, context={}): + def validate(self, cr, uid, ids, context=None): + if context is None: + context = {} task_obj = self.pool.get('project.task') delegate_data = self.read(cr, uid, ids, context=context)[0] task = task_obj.browse(cr, uid, context['active_id'], context=context) |
