[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. 3bf1615ad4
This commit is contained in:
Denis Ledoux 2015-03-23 12:34:00 +01:00
parent aac5c47980
commit 0c16c20c68
1 changed files with 5 additions and 1 deletions

View File

@ -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