From c8a101ffa9cd87293127b9b3e8a5b3953b84d25c Mon Sep 17 00:00:00 2001 From: qdp Date: Mon, 16 Mar 2009 15:07:32 +0100 Subject: [IMP] *improved translatability * When delegating a task twice: * don't put twice 'CHECK: ' * remove check if already in title *When closing tasks, reopen parent only if all childs are done/cancelled bzr revid: qdp@tinyerp.com-20090316140732-isoyrsf3a6ac7qym --- addons/project/wizard/task_delegate.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'addons/project/wizard/task_delegate.py') diff --git a/addons/project/wizard/task_delegate.py b/addons/project/wizard/task_delegate.py index aafed9c3a95..3eb2a5814b4 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 = """
@@ -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'], @@ -77,12 +77,16 @@ 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 return { - 'name':task.name, + 'name': newname, 'user_id': False, 'planned_hours': task.remaining_hours, 'planned_hours_me': 1.0, - 'prefix': 'CHECK: '+ (task.name or ''), + 'prefix': _('CHECK: ')+ (task.name or ''), 'include_info': 1, 'state': 'pending' } -- cgit v1.2.3 From 3cedece2500bd4e8e1adba6de49a1aae7a86ed98 Mon Sep 17 00:00:00 2001 From: qdp Date: Mon, 16 Mar 2009 17:28:26 +0100 Subject: [IMP] * improved view of one2many of delegated tasks [FIX] * don't put twice 'CHECK' if the task is delegated 2 times bzr revid: qdp@tinyerp.com-20090316162826-5q14p9nxpn1numuo --- addons/project/wizard/task_delegate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/project/wizard/task_delegate.py') diff --git a/addons/project/wizard/task_delegate.py b/addons/project/wizard/task_delegate.py index 3eb2a5814b4..d2919dcb54e 100644 --- a/addons/project/wizard/task_delegate.py +++ b/addons/project/wizard/task_delegate.py @@ -80,13 +80,13 @@ class wizard_delegate(wizard.interface): if task.name.startswith(_('CHECK: ')): newname = task.name.strip(_('CHECK: ')) else: - newname = task.name + newname = task.name or '' return { 'name': newname, 'user_id': False, 'planned_hours': task.remaining_hours, 'planned_hours_me': 1.0, - 'prefix': _('CHECK: ')+ (task.name or ''), + 'prefix': _('CHECK: ')+ newname, 'include_info': 1, 'state': 'pending' } -- cgit v1.2.3 From 74a84255ab0a0095bfa3c1dfbe56052086106071 Mon Sep 17 00:00:00 2001 From: qdp Date: Thu, 2 Apr 2009 14:22:47 +0200 Subject: [IMP] in the tree view My Pending Tasks, put the person we delegated the task to (fields.related). [IMP] Tasks delegation, when we delegate a task, there is a checkbox: "copy description". Removed this checkbox and replaced by a text field that shows the descritpion of the task. So that you can edit before confirming delegation. bzr revid: qdp@tinyerp.com-20090402122247-zzjtb8dn0xxw2zld --- addons/project/wizard/task_delegate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'addons/project/wizard/task_delegate.py') diff --git a/addons/project/wizard/task_delegate.py b/addons/project/wizard/task_delegate.py index d2919dcb54e..82f9d7e580e 100644 --- a/addons/project/wizard/task_delegate.py +++ b/addons/project/wizard/task_delegate.py @@ -31,7 +31,7 @@ ask_form = """ - + @@ -42,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}, @@ -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': [] }) @@ -87,7 +87,7 @@ class wizard_delegate(wizard.interface): 'planned_hours': task.remaining_hours, 'planned_hours_me': 1.0, 'prefix': _('CHECK: ')+ newname, - 'include_info': 1, + 'new_task_description': task.description, 'state': 'pending' } -- cgit v1.2.3