diff --git a/addons/report_task/report_task.py b/addons/report_task/report_task.py index aa39769e61f..e4870cdab61 100644 --- a/addons/report_task/report_task.py +++ b/addons/report_task/report_task.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -27,6 +27,9 @@ class report_task_user_pipeline_open (osv.osv): _description = "Tasks by user and project" _auto = False _columns = { + 'name': fields.char('Year',size=64,required=False, readonly=True), + 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'), + ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True), 'user_id':fields.many2one('res.users', 'User', readonly=True), 'task_nbr': fields.float('Task Number', readonly=True), 'task_hrs': fields.float('Task Hours', readonly=True), @@ -40,6 +43,8 @@ class report_task_user_pipeline_open (osv.osv): create or replace view report_task_user_pipeline_open as ( select min(t.id) as id, + to_char(t.create_date, 'YYYY') as name, + to_char(t.create_date,'MM') as month, u.id as user_id, u.company_id as company_id, count(t.*) as task_nbr, @@ -48,12 +53,12 @@ class report_task_user_pipeline_open (osv.osv): case when t.state is null then 'no' else t.state end as task_state from res_users u - left join + left join project_task t on (u.id = t.user_id) where u.active group by - u.id, u.company_id, t.state + to_char(t.create_date, 'YYYY'),to_char(t.create_date,'MM'),u.id, u.company_id, t.state ) ''') report_task_user_pipeline_open() @@ -99,7 +104,7 @@ class report_timesheet_task_user(osv.osv): _name = "report.timesheet.task.user" _auto = False _order = "name" - + def _get_task_hours(self, cr, uid, ids, name,args,context): result = {} for record in self.browse(cr, uid, ids,context): @@ -112,7 +117,7 @@ class report_timesheet_task_user(osv.osv): total += hrs['hours'] result[record.id] = total return result - + def get_hrs_timesheet(self, cr, uid, ids, name,args,context): result = {} sum = 0.0 @@ -126,7 +131,7 @@ class report_timesheet_task_user(osv.osv): total += day_attendance['total_attendance'] result[record.id] = total return result - + _columns = { 'name': fields.char('Year',size=64,required=False, readonly=True), 'user_id': fields.many2one('res.users', 'User',readonly=True), @@ -135,20 +140,20 @@ class report_timesheet_task_user(osv.osv): 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True), } - - - def init(self, cr): + + + def init(self, cr): cr.execute(""" create or replace view report_timesheet_task_user as ( - select + select ((r.id*12)+to_number(months.m_id,'99'))::integer as id, months.name as name, r.id as user_id from res_users r, (select to_char(p.date,'YYYY-MM-01') as name, to_char(p.date,'MM') as m_id - from project_task_work p - - union + from project_task_work p + + union select to_char(h.name,'YYYY-MM-01') as name, to_char(h.name,'MM') as m_id from hr_timesheet_sheet_sheet_day h) as months) """) diff --git a/addons/report_task/report_task_view.xml b/addons/report_task/report_task_view.xml index c0704b031c8..2b5c56bee8a 100644 --- a/addons/report_task/report_task_view.xml +++ b/addons/report_task/report_task_view.xml @@ -1,9 +1,9 @@ - + - + report.project.task.form report.task.user.pipeline.open @@ -19,7 +19,7 @@ - + report.project.task.graph report.task.user.pipeline.open @@ -31,13 +31,15 @@ - + report.project.task.tree report.task.user.pipeline.open tree + + @@ -47,38 +49,38 @@ - - - report.project.task.search - report.project.task + + + report.task.user.pipeline.open.search + report.task.user.pipeline.open search - + - - + - + Tasks by User report.task.user.pipeline.open form tree,graph [] + - + - + report.closed.task.tree report.closed.task @@ -100,7 +102,7 @@ - + Task Closed Within Past 15 Days report.closed.task @@ -108,9 +110,9 @@ tree,form - + - + report.timesheet.task.user.tree report.timesheet.task.user @@ -124,14 +126,14 @@ - + Timesheet / Task Hours Per Month report.timesheet.task.user form tree - - + +