From 0194365e0c7cedf941f2d5261ff537fd161d8b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 5 Sep 2016 10:48:03 +0200 Subject: [PATCH] [IMP] project_issue: slightly improve issue reporting * Number of emails should not take into account internal notifications * Remove Channel and Tasks from issue report as those are not really used anymore * Remove New filter as it can be done through stage filtering instead of using a not obvious heuristic based on stage sequence --- addons/project_issue/models/project_issue.py | 2 +- addons/project_issue/report/project_issue_report.py | 6 +----- addons/project_issue/report/project_issue_report_views.xml | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/addons/project_issue/models/project_issue.py b/addons/project_issue/models/project_issue.py index 64e027d6b35..f2d667a4a50 100644 --- a/addons/project_issue/models/project_issue.py +++ b/addons/project_issue/models/project_issue.py @@ -41,7 +41,7 @@ class ProjectIssue(models.Model): date_closed = fields.Datetime(string='Closed', readonly=True, index=True) date = fields.Datetime('Date') date_last_stage_update = fields.Datetime(string='Last Stage Update', index=True, default=fields.Datetime.now) - channel = fields.Char(string='Channel', help="Communication channel.") + channel = fields.Char(string='Channel', help="Communication channel.") # TDE note: is it still used somewhere ? tag_ids = fields.Many2many('project.tags', string='Tags') priority = fields.Selection([('0', 'Low'), ('1', 'Normal'), ('2', 'High')], 'Priority', index=True, default='0') stage_id = fields.Many2one('project.task.type', string='Stage', track_visibility='onchange', index=True, diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py index 2fd80ed6485..c81f5ccc23c 100644 --- a/addons/project_issue/report/project_issue_report.py +++ b/addons/project_issue/report/project_issue_report.py @@ -25,8 +25,6 @@ class ProjectIssueReport(models.Model): project_id = fields.Many2one('project.project', 'Project', readonly=True) user_id = fields.Many2one('res.users', 'Assigned to', readonly=True) partner_id = fields.Many2one('res.partner', 'Contact') - channel = fields.Char('Channel', readonly=True, help="Communication Channel.") - task_id = fields.Many2one('project.task', 'Task') email = fields.Integer('# Emails', readonly=True) @api.model_cr @@ -49,11 +47,9 @@ class ProjectIssueReport(models.Model): c.project_id as project_id, 1 as nbr_issues, c.partner_id, - c.channel, - c.task_id, c.day_open as delay_open, c.day_close as delay_close, - (SELECT count(id) FROM mail_message WHERE model='project.issue' AND res_id=c.id) AS email + (SELECT count(id) FROM mail_message WHERE model='project.issue' AND message_type IN ('email', 'comment') AND res_id=c.id) AS email FROM project_issue c diff --git a/addons/project_issue/report/project_issue_report_views.xml b/addons/project_issue/report/project_issue_report_views.xml index 5f2d2260fdb..e5aeefedfc4 100644 --- a/addons/project_issue/report/project_issue_report_views.xml +++ b/addons/project_issue/report/project_issue_report_views.xml @@ -48,8 +48,6 @@ - -