diff options
| author | Mustufa Rangwala <mra@mra-laptop> | 2010-07-02 20:15:03 +0530 |
|---|---|---|
| committer | Mustufa Rangwala <mra@mra-laptop> | 2010-07-02 20:15:03 +0530 |
| commit | 2d63bd763496a9b7399d02ca2a4e1e9790442fcb (patch) | |
| tree | a8f1655a658bed949f044c723e43b952d812222b /addons/project/wizard/project_task_delegate.py | |
| parent | 8c8a9c4b92b7901d2871e3a50decca9689c0c96e (diff) | |
| parent | db470305838faecdf26e5535b890b86f7aab2931 (diff) | |
[MERGE] Merge Team3 work from addons3 branch
bzr revid: mra@mra-laptop-20100702144503-0yynbrlkxn0v76lt
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) |
