From fa3a0dbac2b1a140911f2a9158cbcb968c32f375 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 5 Nov 2020 15:47:28 +0000 Subject: [PATCH] [FIX] sale_timesheet: Non billable task in project Overview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce the bug: - Let's consider a product P with price=100€, Timesheets on tasks and Create a task in sales order's project - Create a SO with 1 P and confirm it - A project PR and a task T have been created - Assign an employee E to T and record 01:00 hour - Create an invoice I from the SO and confirm I - Go to the project overview of the SO Bug: 100€ was counted twice in Non billable task and in Billed on Timesheets PS: When validating I, an analytic line L is created and L is not linked to PR. That's why 100€ was counted twice because L was counted once in the 'Invoiced' part and once in the 'Other revenue' opw:2370418 closes odoo/odoo#61880 X-original-commit: 46d254e79900cbb76521d8e6b00f7c7597a914c9 Signed-off-by: Simon Goffin (sig) --- addons/sale_timesheet/models/project_overview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_timesheet/models/project_overview.py b/addons/sale_timesheet/models/project_overview.py index d3b58dd3097..0d7d36cf100 100644 --- a/addons/sale_timesheet/models/project_overview.py +++ b/addons/sale_timesheet/models/project_overview.py @@ -103,7 +103,7 @@ class Project(models.Model): profit['cost'] += data.get('timesheet_cost', 0.0) profit['expense_cost'] += data.get('expense_cost', 0.0) profit['expense_amount_untaxed_invoiced'] += data.get('expense_amount_untaxed_invoiced', 0.0) - profit['other_revenues'] = other_revenues or 0 + profit['other_revenues'] = other_revenues - data.get('amount_untaxed_invoiced', 0.0) if other_revenues else 0.0 profit['total'] = sum([profit[item] for item in profit.keys()]) dashboard_values['profit'] = profit