From 2514c24b20107d66d66f94ea0ed84f5d0afd1301 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 24 Jan 2022 10:41:00 +0000 Subject: [PATCH] [FIX] sale_timesheet: Wrong remaining hour in project update Steps to reproduce the bug: - Create a SO with 1 day of the "Senior Architect" and confirm it - A project P and a task T are automatically created - Record multiple timesheets for T Bug: The remaining hours was wrong PS: qty_delivered was already computed in timesheet_encode_uom_id opw:2731384 closes odoo/odoo#83290 X-original-commit: e7ef52b5110d3138d9a0144cee61bc0847e27fff Signed-off-by: Laurent Stukkens (ltu) --- addons/sale_timesheet/models/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_timesheet/models/project.py b/addons/sale_timesheet/models/project.py index 4ac5bd42ba8..cdbc9bac265 100644 --- a/addons/sale_timesheet/models/project.py +++ b/addons/sale_timesheet/models/project.py @@ -333,7 +333,7 @@ class Project(models.Model): #We only want to consider hours and days for this calculation, and eventually units if the service policy is not based on milestones if sol.product_uom.category_id == self.env.company.timesheet_encode_uom_id.category_id or (sol.product_uom == product_uom_unit and sol.product_id.service_policy != 'delivered_manual'): sold_items['total_sold'] += product_uom_qty - sold_items['effective_sold'] += sol.product_uom._compute_quantity(qty_delivered, self.env.company.timesheet_encode_uom_id, raise_if_failure=False) + sold_items['effective_sold'] += qty_delivered remaining = sold_items['total_sold'] - sold_items['effective_sold'] sold_items['remaining'] = { 'value': remaining,