negative remaining_hours in project_task

Bug #716882 reported by jugglefish
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Wishlist
OpenERP R&D Addons Team 1

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))

Tags: project
Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 1 (openerp-dev-addons1)
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
t.o (emailbox4oerp) wrote :

Hello Amit,

If the task is linked with a project, the indicators of the project are wrong.
On the project view, the time spent and total time of the project are =0...

Thanks

Revision history for this message
os_33 (olivier-s) wrote :

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

tags: added: project
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.