From 0c16c20c68ba12b5a2e7c35c3b87609ed6d846e4 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 23 Mar 2015 12:34:00 +0100 Subject: [PATCH] [FIX] hr_timesheet: timezone of anayltic sheets in sheet summary The timezone of hr_analytic_sheet should be the timezone of the employee as well, so sheet analytic lines and attendances lines are grouped within the same timezone, the timezone of the employees, so the time difference between the analytic lines and the attendances lines can be properly computed. Fixes #5809 Fixes #5379 Related to rev. 3bf1615ad40f23212a0fff23eeb506f3bcc69043 --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 4fd0ecbdca7..ceb661f2bb6 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -549,7 +549,7 @@ class hr_timesheet_sheet_sheet_day(osv.osv): (( select min(hrt.id) as id, - 'UTC' as timezone, + p.tz as timezone, l.date::date as name, s.id as sheet_id, sum(l.unit_amount) as total_timesheet, @@ -559,6 +559,10 @@ class hr_timesheet_sheet_sheet_day(osv.osv): hr_analytic_timesheet hrt JOIN account_analytic_line l ON l.id = hrt.line_id LEFT JOIN hr_timesheet_sheet_sheet s ON s.id = hrt.sheet_id + JOIN hr_employee e ON s.employee_id = e.id + JOIN resource_resource r ON e.resource_id = r.id + LEFT JOIN res_users u ON r.user_id = u.id + LEFT JOIN res_partner p ON u.partner_id = p.id group by l.date::date, s.id, timezone ) union ( select