summaryrefslogtreecommitdiff
path: root/addons/project/models/project.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/project/models/project.py')
-rw-r--r--addons/project/models/project.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/addons/project/models/project.py b/addons/project/models/project.py
index 85aea626c09..8a7ef37a487 100644
--- a/addons/project/models/project.py
+++ b/addons/project/models/project.py
@@ -435,7 +435,7 @@ class Task(models.Model):
_date_name = "date_start"
_inherit = ['portal.mixin', 'mail.thread', 'mail.activity.mixin', 'rating.mixin']
_mail_post_access = 'read'
- _order = "priority desc, sequence, date_start, name, id"
+ _order = "priority desc, sequence, id desc"
@api.model
def default_get(self, fields_list):
@@ -492,7 +492,7 @@ class Task(models.Model):
index=True, copy=False)
date_end = fields.Datetime(string='Ending Date', index=True, copy=False)
date_assign = fields.Datetime(string='Assigning Date', index=True, copy=False, readonly=True)
- date_deadline = fields.Date(string='Deadline', index=True, copy=False)
+ date_deadline = fields.Date(string='Deadline', index=True, copy=False, track_visibility='onchange')
date_last_stage_update = fields.Datetime(string='Last Stage Update',
default=fields.Datetime.now,
index=True,
@@ -505,8 +505,8 @@ class Task(models.Model):
track_visibility='onchange',
change_default=True)
notes = fields.Text(string='Notes')
- planned_hours = fields.Float("Planned Hours", help='It is the time planned to achieve the task. If this document has sub-tasks, it means the time needed to achieve this tasks and its childs.')
- subtask_planned_hours = fields.Float("Subtask Planned Hours", compute='_compute_subtask_planned_hours', help="Computed using sum of hours planned of all subtasks created from main task. Usually these hours are less or equal to the Planned Hours (of main task).")
+ planned_hours = fields.Float("Planned Hours", help='It is the time planned to achieve the task. If this document has sub-tasks, it means the time needed to achieve this tasks and its childs.',track_visibility='onchange')
+ subtask_planned_hours = fields.Float("Subtasks", compute='_compute_subtask_planned_hours', help="Computed using sum of hours planned of all subtasks created from main task. Usually these hours are less or equal to the Planned Hours (of main task).")
remaining_hours = fields.Float(string='Remaining Hours', digits=(16,2), help="Total remaining time, can be re-estimated periodically by the assignee of the task.")
user_id = fields.Many2one('res.users',
string='Assigned to',
@@ -528,7 +528,7 @@ class Task(models.Model):
legend_blocked = fields.Char(related='stage_id.legend_blocked', string='Kanban Blocked Explanation', readonly=True, related_sudo=False)
legend_done = fields.Char(related='stage_id.legend_done', string='Kanban Valid Explanation', readonly=True, related_sudo=False)
legend_normal = fields.Char(related='stage_id.legend_normal', string='Kanban Ongoing Explanation', readonly=True, related_sudo=False)
- parent_id = fields.Many2one('project.task', string='Parent Task')
+ parent_id = fields.Many2one('project.task', string='Parent Task', index=True)
child_ids = fields.One2many('project.task', 'parent_id', string="Sub-tasks")
subtask_count = fields.Integer("Sub-task count", compute='_compute_subtask_count')
email_from = fields.Char(string='Email', help="These people will receive email.", index=True)
@@ -539,6 +539,8 @@ class Task(models.Model):
working_hours_close = fields.Float(compute='_compute_elapsed', string='Working hours to close', store=True, group_operator="avg")
working_days_open = fields.Float(compute='_compute_elapsed', string='Working days to assign', store=True, group_operator="avg")
working_days_close = fields.Float(compute='_compute_elapsed', string='Working days to close', store=True, group_operator="avg")
+ # customer portal: include comment and incoming emails in communication history
+ website_message_ids = fields.One2many(domain=lambda self: [('model', '=', self._name), ('message_type', 'in', ['email', 'comment'])])
_constraints = [(models.BaseModel._check_recursion, 'Circular references are not permitted between tasks and sub-tasks', ['parent_id'])]