[FIX] sale_timesheet: Wrong remaining value in Project overview

Steps to reproduce the bug:
- Create a project called "R&D"
- Create two service products P1 and P2 with 'Timesheets on tasks' and
'Create a task in an existing project' for project 'R&D'
- Create a SO1 with 5 P1 and SO2 with 10 P2 and confirm SO1 and SO2
- Deliver 1 hour for P1 and 2 hours for P2 (with timesheets)
- Click on "Project Overview" button

Bug:

The remaining hours for SO1 was 12 hours instead of 4 hours and the remaining hours
for SO2 was 12 hours instead of 8 hours

opw:1981903

closes odoo/odoo#33183

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
Goffin Simon
2019-05-06 11:29:47 +00:00
parent ddb8fc1f62
commit b80a6df68a
+1 -1
View File
@@ -200,7 +200,7 @@ class SaleTimesheetController(http.Controller):
rows_sale_line[sale_line_row_key][-1] = 0
rows_sale_order = {} # so -> [INFO, before, M1, M2, M3, Done, M3, M4, M5, After, Forecasted]
rows_sale_order_done_sold = dict.fromkeys(set(map_sol_so.values()) | set([None]), dict(sold=0.0, done=0.0)) # SO id -> {'sold':0.0, 'done': 0.0}
rows_sale_order_done_sold = {key : dict(sold=0.0, done=0.0) for key in set(map_sol_so.values()) | set([None])} # SO id -> {'sold':0.0, 'done': 0.0}
for row_key, row_sale_line in rows_sale_line.items():
sale_order_id = row_key[0]
# sale order row