summaryrefslogtreecommitdiff
path: root/addons/project/wizard/task_delegate.py
diff options
context:
space:
mode:
authorhusen daudi <hda@hda>2009-04-13 18:13:13 +0530
committerhusen daudi <hda@hda>2009-04-13 18:13:13 +0530
commitea2efc15067b3b5f6448a5bce7baae8880c7bfbb (patch)
tree921b362d733c0e601792aa59955a81cd70722f3a /addons/project/wizard/task_delegate.py
parent7767525f1edc8c5e7dd32678ffce9ed2d19310a7 (diff)
parent4b180641bdc3356ec778a98bc10d936042a8fc12 (diff)
Ported all bugs from trunk to stable
bzr revid: hda@hda-20090413124313-x9gdobzpxf1lkfxl
Diffstat (limited to 'addons/project/wizard/task_delegate.py')
-rw-r--r--addons/project/wizard/task_delegate.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/addons/project/wizard/task_delegate.py b/addons/project/wizard/task_delegate.py
index aafed9c3a95..82f9d7e580e 100644
--- a/addons/project/wizard/task_delegate.py
+++ b/addons/project/wizard/task_delegate.py
@@ -23,6 +23,7 @@
import wizard
from tools import email_send as email
import pooler
+from tools.translate import _
ask_form = """<?xml version="1.0" ?>
<form string="Delegate this task to a user">
@@ -30,7 +31,7 @@ ask_form = """<?xml version="1.0" ?>
<field name="user_id" colspan="4"/>
<field name="planned_hours" colspan="4" widget="float_time"/>
<field name="name" colspan="4"/>
- <field name="include_info"/>
+ <field name="new_task_description"/>
<separator string="Validation Task" colspan="4"/>
<field name="planned_hours_me" colspan="4" widget="float_time"/>
<field name="prefix" colspan="4"/>
@@ -41,7 +42,7 @@ ask_fields = {
'name': {'string': 'Delegated Title', 'type': 'char', 'required': 'True', 'size':64, 'help':"New title of the task delegated to the user."},
'prefix': {'string': 'Your Task Title', 'type': 'char', 'required': 'True', 'size':64, 'help':"New title of your own task to validate the work done."},
'user_id': {'string':'Assign To', 'type':'many2one', 'relation': 'res.users', 'required':'True', 'help':"User you want to delegate this task to."},
- 'include_info': {'string':'Copy Description', 'type':'boolean', 'help':"Reinclude the description of the task in the task of the user."},
+ 'new_task_description': {'string':'New Task Description', 'type':'text', 'help':"Reinclude the description of the task in the task of the user."},
'planned_hours': {'string':'Planned Hours', 'type':'float', 'widget':'float_time', 'help':"Estimated time to close this task by the delegated user."},
'planned_hours_me': {'string':'Hours to Validate', 'type':'float', 'widget':'float_time', 'help':"Estimated time for you to validate the work done by the user to whom you delegate this task."},
'state': {'string':'Validation State', 'type':'selection', 'selection': [('pending','Pending'),('done','Done')], 'help':"New state of your own task. Pending will be reopened automatically when the delegated task is closed.", 'required':True},
@@ -51,7 +52,6 @@ class wizard_delegate(wizard.interface):
def _do_assign(self, cr, uid, data, context):
task_obj = pooler.get_pool(cr.dbname).get('project.task')
task = task_obj.browse(cr, uid, data['id'], context)
- newname = task.name
newname = data['form']['prefix'] or ''
task_obj.copy(cr, uid, data['id'], {
'name': data['form']['name'],
@@ -60,7 +60,7 @@ class wizard_delegate(wizard.interface):
'remaining_hours': data['form']['planned_hours'],
'parent_id': data['id'],
'state': 'open',
- 'description': data['form']['include_info'] and task.description or '',
+ 'description': data['form']['new_task_description'] or '',
'child_ids': [],
'work_ids': []
})
@@ -77,13 +77,17 @@ class wizard_delegate(wizard.interface):
def _ask_auto_complete(self, cr, uid, data, context):
task_obj = pooler.get_pool(cr.dbname).get('project.task')
task = task_obj.browse(cr, uid, data['id'], context)
+ if task.name.startswith(_('CHECK: ')):
+ newname = task.name.strip(_('CHECK: '))
+ else:
+ newname = task.name or ''
return {
- 'name':task.name,
+ 'name': newname,
'user_id': False,
'planned_hours': task.remaining_hours,
'planned_hours_me': 1.0,
- 'prefix': 'CHECK: '+ (task.name or ''),
- 'include_info': 1,
+ 'prefix': _('CHECK: ')+ newname,
+ 'new_task_description': task.description,
'state': 'pending'
}