diff options
| author | qdp <qdp@tinyerp.com> | 2009-03-16 15:07:32 +0100 |
|---|---|---|
| committer | qdp <qdp@tinyerp.com> | 2009-03-16 15:07:32 +0100 |
| commit | c8a101ffa9cd87293127b9b3e8a5b3953b84d25c (patch) | |
| tree | 0c43ddf66a7888a4a015d0a112e1cbe3d374dbdd /addons/project/project.py | |
| parent | 7a9ef2b5353d583e02a61e5e67ba0ac83772eff4 (diff) | |
[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
Diffstat (limited to 'addons/project/project.py')
| -rw-r--r-- | addons/project/project.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/addons/project/project.py b/addons/project/project.py index ecbb98635ba..cd980ab2738 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -24,6 +24,7 @@ from lxml import etree from mx import DateTime from mx.DateTime import now import time +from tools.translate import _ from osv import fields, osv @@ -335,7 +336,7 @@ class task(osv.osv): if project: if project.warn_manager and project.manager and (project.manager.id != uid): request.create(cr, uid, { - 'name': "Task '%s' closed" % task.name, + 'name': _("Task '%s' closed") % task.name, 'state': 'waiting', 'act_from': uid, 'act_to': project.manager.id, @@ -345,7 +346,12 @@ class task(osv.osv): }) self.write(cr, uid, [task.id], {'state': 'done', 'date_close':time.strftime('%Y-%m-%d %H:%M:%S'), 'remaining_hours': 0.0}) if task.parent_id and task.parent_id.state in ('pending','draft'): - self.do_reopen(cr, uid, [task.parent_id.id]) + reopen = True + for child in task.parent_id.child_ids: + if child.id != task.id and child.state not in ('done','cancelled'): + reopen = False + if reopen: + self.do_reopen(cr, uid, [task.parent_id.id]) return True def do_reopen(self, cr, uid, ids, *args): @@ -355,7 +361,7 @@ class task(osv.osv): project = task.project_id if project and project.warn_manager and project.manager.id and (project.manager.id != uid): request.create(cr, uid, { - 'name': "Task '%s' set in progress" % task.name, + 'name': _("Task '%s' set in progress") % task.name, 'state': 'waiting', 'act_from': uid, 'act_to': project.manager.id, @@ -374,7 +380,7 @@ class task(osv.osv): project = task.project_id if project.warn_manager and project.manager and (project.manager.id != uid): request.create(cr, uid, { - 'name': "Task '%s' cancelled" % task.name, + 'name': _("Task '%s' cancelled") % task.name, 'state': 'waiting', 'act_from': uid, 'act_to': project.manager.id, |
