diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py index ef1e002ae78..775e4b933f0 100755 --- a/addons/project_issue/report/project_issue_report.py +++ b/addons/project_issue/report/project_issue_report.py @@ -7,15 +7,20 @@ class project_issue_report(osv.osv): _auto = False _inherit = "crm.case.report" _columns = { - 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'project.issue.report')]"), - 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'project.issue.report')]"), - 'nbr': fields.integer('# of Issues', reaadonly=True), - 'delay_close': fields.char('Delay to close', size=20, readonly=True), + 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'project.issue')]"), + 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'project.issue')]"), + 'nbr': fields.integer('# of Issues', readonly=True), + 'delay_close': fields.float('Avg Closing Delay', digits=(16,2), readonly=True, group_operator="avg", + help="Number of Days to close the project issue"), 'company_id' : fields.many2one('res.company', 'Company'), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'), - 'project_id':fields.many2one('project.project', 'Project'), - 'type_id': fields.many2one('crm.case.resource.type', 'Bug Type', domain="[('object_id.model', '=', 'project.issue')]"), + 'project_id':fields.many2one('project.project', 'Project',readonly=True), + 'type_id': fields.many2one('crm.case.resource.type', 'Type', domain="[('object_id.model', '=', 'project.issue')]"), 'date_closed': fields.datetime('Close Date', readonly=True), + 'assigned_to' : fields.many2one('res.users', 'Assigned to',readonly=True), + 'partner_id': fields.many2one('res.partner','Partner',domain="[('object_id.model', '=', 'project.issue')]"), + 'canal_id': fields.many2one('res.partner.canal', 'Channel',readonly=True), + 'task_id': fields.many2one('project.task', 'Task',domain="[('object_id.model', '=', 'project.issue')]" ) } def init(self, cr): tools.drop_view_if_exists(cr, 'project_issue_report') @@ -25,6 +30,7 @@ class project_issue_report(osv.osv): min(c.id) as id, to_char(c.create_date, 'YYYY') as name, to_char(c.create_date, 'MM') as month, + to_char(c.create_date, 'YYYY-MM-DD') as day, c.state, c.user_id, c.section_id, @@ -35,18 +41,41 @@ class project_issue_report(osv.osv): c.priority as priority, c.project_id as project_id, c.type_id as type_id, - count(*) as nbr, - to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close + count(*) as nbr, + c.assigned_to, + c.partner_id, + c.canal_id, + c.task_id, + date_trunc('day',c.create_date) as create_date, + avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close from project_issue c left join res_users u on (c.id = u.id) - group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.categ_id,c.stage_id - ,c.date_closed,u.company_id,c.priority,c.project_id,c.type_id + group by + to_char(c.create_date, 'YYYY'), + to_char(c.create_date, 'MM'), + to_char(c.create_date, 'YYYY-MM-DD'), + c.state, + c.user_id, + c.section_id, + c.categ_id, + c.stage_id, + c.date_closed, + u.company_id, + c.priority, + c.project_id, + c.type_id, + date_trunc('day',c.create_date), + c.assigned_to, + c.partner_id, + c.canal_id, + c.task_id )""") project_issue_report() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml index 72d665cdff0..24290530be7 100755 --- a/addons/project_issue/report/project_issue_report_view.xml +++ b/addons/project_issue/report/project_issue_report_view.xml @@ -7,23 +7,28 @@ project.issue.report tree - - - - - - - - - - - + + + + + + + + + - + + + + - + + + + + @@ -45,39 +50,34 @@ search - - - - - + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -85,8 +85,15 @@ - - + + + + + + + + + @@ -97,6 +104,7 @@ project.issue.report form graph,tree + {"search_default_This Month":1,"search_default_User":1,'group_by_no_leaf':1,'group_by':[]} @@ -117,5 +125,7 @@ + + - + \ No newline at end of file