← Back to team overview

openerp-india team mailing list archive

[Bug 716882] Re: negative remaining_hours in project_task

 

Hello,

Tested  on Version 6.1 RC1.

Create a new project.

Create a first task linked with this project  :
 - planned hours = 10
 - add a task work for 3 hours
 - save the task -> Total hours = 10 , Remainning hours =7   OK

Create a second task linked with the previous project
 - planned hours = 0
 - add a task work for 3 hours
 - save the task -> Total hours = 0 , Remainning hours =-3  
This second task is used to historize the customers extra requests appeared during the project and not planned at the beginning. I wonder if there is another way to manage this

Go to Reporting>Tasks>Tasks analysis
-total and planned hours =10
-Effective hours = 6
-Remainning hours = 4 !!!!!! instead of 7

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/716882

Title:
  negative remaining_hours in project_task

Status in OpenERP Addons (modules):
  Confirmed

Bug description:
  As soon as the effectivly done work on a task in hours exceeds the
  planned hours I'd expect the delay_hours to reflect that situation.
  However instead the remaining_hours will further decreased turning
  into a negative number.

  steps to reproduce:
  1. create a task with 0-X planned hours (0 to see the effect straight away)
  2. do some work on the task (less then X)
  3. see remaining hours decrease
  4. Up to now: everything fine
  5. do some work so the effective hours exceed the plannend hours(X)
  6. Remaining hours turn negative

  how to fix:
  * IMO reamining_hours must never be less than 0
  * when saving the work and recalculation is done remaining hours should only be lowered to minimum 0

  project/project.py
  class project_work(osv.osv)
  def write 
   cr.execute('update project_task set remaining_hours=remaining_hours - %s + (%s) where id=%s', (vals.get('hours',0.0), work.hours, work.task_id.id))

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/716882/+subscriptions