From 23ddb3ce63b373f634d90fe9be289be844674c58 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 17 Aug 2017 15:05:24 +0200 Subject: [PATCH] [FIX] sale_timesheet: count timesheet with employees only Timesheet created using the UI are supposed to all have an employee defined. However, this field is not required and it is possible to have timesheet without a user defined. Feedback ged from saas-16 migration --- addons/sale_timesheet/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_timesheet/controllers/main.py b/addons/sale_timesheet/controllers/main.py index 7aff42ff99d..975b79523a9 100644 --- a/addons/sale_timesheet/controllers/main.py +++ b/addons/sale_timesheet/controllers/main.py @@ -59,7 +59,7 @@ class SaleTimesheetController(http.Controller): values['dashboard'] = dashboard_values # -- Time Repartition (per employee) - repartition_domain = domain + [('timesheet_invoice_type', '!=', False)] # force billable type + repartition_domain = domain + [('employee_id', '!=', False), ('timesheet_invoice_type', '!=', False)] # force billable type repartition_data = request.env['account.analytic.line'].read_group(repartition_domain, ['employee_id', 'timesheet_invoice_type', 'unit_amount'], ['employee_id', 'timesheet_invoice_type'], lazy=False) # set repartition per type per employee