[IMP] Peoject->task - Dealy Value
bzr revid: ron@tinyerp.com-20101015133729-id40xkl3qb8lu20e
This commit is contained in:
@@ -395,10 +395,13 @@ class task(osv.osv):
|
||||
if hours.get(task.id, False):
|
||||
dur_in_user_uom = uom_obj._compute_qty(cr, uid, default_uom, hours.get(task.id, 0.0), user_uom)
|
||||
hours[task.id] = dur_in_user_uom
|
||||
|
||||
timespent=0
|
||||
for task in self.browse(cr, uid, ids, context=context):
|
||||
res[task.id] = {'effective_hours': hours.get(task.id, 0.0), 'total_hours': task.remaining_hours + hours.get(task.id, 0.0)}
|
||||
res[task.id]['delay_hours'] = res[task.id]['total_hours'] - task.planned_hours
|
||||
# res[task.id]['delay_hours'] = res[task.id]['total_hours'] - task.planned_hours
|
||||
for ctimespent in task.work_ids:
|
||||
timespent=timespent+ctimespent.hours
|
||||
res[task.id]['delay_hours'] = task.planned_hours - timespent
|
||||
res[task.id]['progress'] = 0.0
|
||||
if (task.remaining_hours + hours.get(task.id, 0.0)):
|
||||
res[task.id]['progress'] = round(min(100.0 * hours.get(task.id, 0.0) / res[task.id]['total_hours'], 99.99),2)
|
||||
|
||||
Reference in New Issue
Block a user