summaryrefslogtreecommitdiff
path: root/addons/project/wizard/project_task_delegate.py
diff options
context:
space:
mode:
authoruco (OpenERP) <uco@tinyerp.com>2010-11-10 17:29:59 +0530
committeruco (OpenERP) <uco@tinyerp.com>2010-11-10 17:29:59 +0530
commitbdb8814237c28f0b296cd7173dc580aa48e85b69 (patch)
tree772ad4a3b43bce85b055d9451f1a6d563f1caff6 /addons/project/wizard/project_task_delegate.py
parentfc80c9a5eb1c6b9d2d52a75fd0d550445fbd2e52 (diff)
[FIX] project: Fixed encoding error on task name in Delegate wizard.
lp bug: https://launchpad.net/bugs/670914 fixed bzr revid: uco@tinyerp.com-20101110115959-nd8h9v8910hr3jvc
Diffstat (limited to 'addons/project/wizard/project_task_delegate.py')
-rw-r--r--addons/project/wizard/project_task_delegate.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/addons/project/wizard/project_task_delegate.py b/addons/project/wizard/project_task_delegate.py
index ac160fb6c94..9fc5d21e424 100644
--- a/addons/project/wizard/project_task_delegate.py
+++ b/addons/project/wizard/project_task_delegate.py
@@ -48,20 +48,21 @@ class project_task_delegate(osv.osv_memory):
record_id = context and context.get('active_id', False) or False
task_pool = self.pool.get('project.task')
task = task_pool.browse(cr, uid, record_id, context=context)
+ task_name = (task.name).encode('utf-8')
if 'name' in fields:
- if task.name.startswith(_('CHECK: ')):
- newname = str(task.name).replace(_('CHECK: '), '')
+ if task_name.startswith(_('CHECK: ')):
+ newname = str(task_name).replace(_('CHECK: '), '')
else:
- newname = task.name or ''
+ newname = task_name or ''
res.update({'name': newname})
if 'planned_hours' in fields:
res.update({'planned_hours': task.remaining_hours or 0.0})
if 'prefix' in fields:
- if task.name.startswith(_('CHECK: ')):
- newname = str(task.name).replace(_('CHECK: '), '')
+ if task_name.startswith(_('CHECK: ')):
+ newname = str(task_name).replace(_('CHECK: '), '')
else:
- newname = task.name or ''
+ newname = task_name or ''
prefix = _('CHECK: ') + newname
res.update({'prefix': prefix})
if 'new_task_description' in fields:
@@ -103,6 +104,7 @@ class project_task_delegate(osv.osv_memory):
task_id = context.get('active_id', False)
task_pool = self.pool.get('project.task')
delegate_data = self.read(cr, uid, ids, context=context)[0]
+ delegate_data['name'] = (delegate_data['name']).decode('utf-8')
task_pool.do_delegate(cr, uid, task_id, delegate_data, context=context)
return {}