[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
This commit is contained in:
Martin Trigaux
2017-08-17 15:14:50 +02:00
parent 6bafe8e9a8
commit 23ddb3ce63
+1 -1
View File
@@ -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