Validation on tasks improvement

bzr revid: fp@tinyerp.com-291e860a6711663bbeda156923a59c71e52d0991
This commit is contained in:
Fabien Pinckaers
2007-10-07 15:07:02 +00:00
parent 21bcadd7f3
commit eadf38e3c3
2 changed files with 10 additions and 4 deletions
+3 -1
View File
@@ -171,7 +171,9 @@ class task(osv.osv):
_description = "Task"
_date_name = "date_deadline"
def _str_get(self, task, level=0, border='***', context={}):
return border+' '+task.user_id.name.upper()+(level and (': L'+str(level)) or '')+(' - %.1fh / %.1fh'%(task.effective_hours or 0.0,task.planned_hours))+' '+border+'\n'+(task.description or '')+'\n\n'
return border+' '+task.user_id.name.upper()+(level and (': L'+str(level)) or '')+(' - %.1fh / %.1fh'%(task.effective_hours or 0.0,task.planned_hours))+' '+border+'\n'+ \
border[0]+' '+(task.name or '')+'\n'+ \
(task.description or '')+'\n\n'
def _history_get(self, cr, uid, ids, name, args, context={}):
result = {}
+7 -3
View File
@@ -56,17 +56,21 @@ 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
if not task.name.startswith(data['form']['prefix'] or '++'):
newname = (data['form']['prefix'] or '')+task.name
task_obj.copy(cr, uid, data['id'], {
'name': data['form']['name'],
'user_id': data['form']['user_id'],
'planned_hours': data['form']['planned_hours'],
'parent_id': data['id'],
'state': 'open',
'description': data['form']['include_info'] and task.description or ''
'description': data['form']['include_info'] and task.description or '',
'child_ids': []
})
task_obj.write(cr, uid, data['id'], {
'planned_hours': data['form']['planned_hours_me'],
'name': (data['form']['prefix'] or '')+task.name
'name': newname
})
if data['form']['state']=='pending':
task_obj.do_pending(cr, uid, [data['id']])
@@ -82,7 +86,7 @@ class wizard_delegate(wizard.interface):
'user_id': False,
'planned_hours': task.planned_hours,
'planned_hours_me': task.planned_hours / 5.0,
'prefix': 'VALIDATION: ',
'prefix': 'CHECK: ',
'state': 'pending'
}