From d7504b7f20e828a45c2c5beae5914c30414c20bd Mon Sep 17 00:00:00 2001 From: "Priyesh (OpenERP)" <> Date: Thu, 29 Nov 2012 16:50:39 +0530 Subject: [PATCH] [FIX]project_timesheet: Fix KeyError: user_id coming due to not creation unique id from postgres view bzr revid: mma@tinyerp.com-20121129112039-fz7jzsdza48z631c --- addons/project_timesheet/report/task_report.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/project_timesheet/report/task_report.py b/addons/project_timesheet/report/task_report.py index 89476b991b1..bdc51d0a25e 100644 --- a/addons/project_timesheet/report/task_report.py +++ b/addons/project_timesheet/report/task_report.py @@ -56,7 +56,7 @@ class report_timesheet_task_user(osv.osv): tools.drop_view_if_exists(cr, 'report_timesheet_task_user') cr.execute(""" create or replace view report_timesheet_task_user as ( select - ((r.id*12)+to_number(months.m_id,'99'))::integer as id, + ((r.id*12)+to_number(months.m_id,'999999'))::integer as id, months.name as name, r.id as user_id, to_char(to_date(months.name, 'YYYY/MM/DD'),'YYYY') as year, @@ -65,12 +65,12 @@ class report_timesheet_task_user(osv.osv): interval '1 day') ) as task_hrs from res_users r, (select to_char(p.date,'YYYY-MM-01') as name, - to_char(p.date,'MM') as m_id + to_char(p.date,'YYYYMM') as m_id from project_task_work p union select to_char(h.name,'YYYY-MM-01') as name, - to_char(h.name,'MM') as m_id + to_char(h.name,'YYYYMM') as m_id from hr_timesheet_sheet_sheet_day h) as months group by