[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
This commit is contained in:
Thibault Delavallée
2016-09-05 12:18:42 +02:00
parent d3bbcd6474
commit 0194365e0c
3 changed files with 2 additions and 8 deletions
+1 -1
View File
@@ -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,
@@ -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
@@ -48,8 +48,6 @@
<field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
<field name="stage_id"/>
<filter string="Unassigned" name="unassigned" domain="[('user_id','=',False)]"/>
<separator/>
<filter string="New" name="new" domain="[('stage_id.sequence', '&lt;=', 1)]"/>
<group expand="1" string="Group By">
<filter string="Assigned to" name="Responsible" context="{'group_by':'user_id'}" />
<filter string="Project" name="project" context="{'group_by':'project_id'}" />