[IMP] project, project_issue: set default kanban values as color instead of labels

Kanban state values are different from their visual display. When searching
on kanban state it is not easy to understand the link between the label
and the color. We now set the label as the color to ease matching and
searching. However in kanban view labels can be defined on the stage
itself. This way searching is done on the color while working with
tasks and issues in kanban is done using business meaning defined on
the stage.
This commit is contained in:
Thibault Delavallée
2016-11-09 10:40:36 +01:00
parent 327447dbb6
commit 038c177f3f
2 changed files with 19 additions and 19 deletions
+10 -13
View File
@@ -29,13 +29,13 @@ class ProjectTaskType(models.Model):
string='Priority Management Explanation', translate=True,
help='Explanation text to help users using the star and priority mechanism on stages or issues that are in this stage.')
legend_blocked = fields.Char(
string='Kanban Blocked Explanation', translate=True,
'Red Kanban Label', default='Blocked', translate=True,
help='Override the default value displayed for the blocked state for kanban selection, when the task or issue is in that stage.')
legend_done = fields.Char(
string='Kanban Valid Explanation', translate=True,
'Green Kanban Label', default='Ready for Next Stage', translate=True,
help='Override the default value displayed for the done state for kanban selection, when the task or issue is in that stage.')
legend_normal = fields.Char(
string='Kanban Ongoing Explanation', translate=True,
'Grey Kanban Label', default='In Progress', translate=True,
help='Override the default value displayed for the normal state for kanban selection, when the task or issue is in that stage.')
mail_template_id = fields.Many2one(
'mail.template',
@@ -335,17 +335,14 @@ class Task(models.Model):
domain="[('project_ids', '=', project_id)]", copy=False)
tag_ids = fields.Many2many('project.tags', string='Tags', oldname='categ_ids')
kanban_state = fields.Selection([
('normal', 'In Progress'),
('done', 'Ready for next stage'),
('blocked', 'Blocked')
], string='Kanban State',
default='normal',
track_visibility='onchange',
required=True, copy=False,
('normal', 'Grey'),
('done', 'Green'),
('blocked', 'Red')], string='Kanban State',
copy=False, default='normal', required=True, track_visibility='onchange',
help="A task's kanban state indicates special situations affecting it:\n"
" * Normal is the default situation\n"
" * Blocked indicates something is preventing the progress of this task\n"
" * Ready for next stage indicates the task is ready to be pulled to the next stage")
" * Grey is the default situation\n"
" * Red indicates something is preventing the progress of this task\n"
" * Green indicates the task is ready to be pulled to the next stage")
create_date = fields.Datetime(index=True)
write_date = fields.Datetime(index=True) #not displayed in the view but it might be useful with base_action_rule module (and it needs to be defined first for that)
date_start = fields.Datetime(string='Starting Date',
+9 -6
View File
@@ -28,12 +28,15 @@ class ProjectIssue(models.Model):
partner_id = fields.Many2one('res.partner', string='Contact', index=True)
company_id = fields.Many2one('res.company', string='Company', default=lambda self: self.env.user.company_id)
description = fields.Text('Private Note')
kanban_state = fields.Selection([('normal', 'Normal'), ('blocked', 'Blocked'), ('done', 'Ready for next stage')], string='Kanban State',
track_visibility='onchange', required=True, default='normal',
help="""An Issue's kanban state indicates special situations affecting it:\n
* Normal is the default situation\n
* Blocked indicates something is preventing the progress of this issue\n
* Ready for next stage indicates the issue is ready to be pulled to the next stage""")
kanban_state = fields.Selection([
('normal', 'Grey'),
('blocked', 'Red'),
('done', 'Green')], string='Kanban State',
default='normal', required=True, track_visibility='onchange',
help="An Issue's kanban state indicates special situations affecting it:\n"
" * Grey is the default situation\n"
" * Red indicates something is preventing the progress of this issue\n"
" * Green indicates the issue is ready to be pulled to the next stage")
email_from = fields.Char(string='Email', help="These people will receive email.", index=True)
email_cc = fields.Char(string='Watchers Emails', help="""These email addresses will be added to the CC field of all inbound
and outbound emails for this record before being sent. Separate multiple email addresses with a comma""")