[IMP] project: add a properties field on task
Purpose ======= To be able to customize the working flow on the task, based on their project, we add a properties field on tasks, whose definition is stored on their project. Task-2965523 X-original-commit: 2f244769cbb1512875ae197aa8adc3efd34fd54b Part-of: odoo/odoo#101487
This commit is contained in:
@@ -361,6 +361,7 @@ class Project(models.Model):
|
||||
allow_task_dependencies = fields.Boolean('Task Dependencies', default=lambda self: self.env.user.has_group('project.group_project_task_dependencies'))
|
||||
allow_milestones = fields.Boolean('Milestones', default=lambda self: self.env.user.has_group('project.group_project_milestone'))
|
||||
tag_ids = fields.Many2many('project.tags', relation='project_project_project_tags_rel', string='Tags')
|
||||
task_properties_definition = fields.PropertiesDefinition('Task Properties')
|
||||
|
||||
# Project Sharing fields
|
||||
collaborator_ids = fields.One2many('project.collaborator', 'project_id', string='Collaborators', copy=False)
|
||||
@@ -1122,8 +1123,9 @@ class Task(models.Model):
|
||||
help="Date on which the stage of your task has last been modified.\n"
|
||||
"Based on this information you can identify tasks that are stalling and get statistics on the time it usually takes to move tasks from one stage to another.")
|
||||
project_id = fields.Many2one('project.project', string='Project', recursive=True,
|
||||
compute='_compute_project_id', store=True, readonly=False,
|
||||
compute='_compute_project_id', store=True, readonly=False, precompute=True,
|
||||
index=True, tracking=True, check_company=True, change_default=True)
|
||||
task_properties = fields.Properties('Properties', definition='project_id.task_properties_definition', copy=True)
|
||||
# Defines in which project the task will be displayed / taken into account in statistics.
|
||||
# Example: 1 task A with 1 subtask B in project P
|
||||
# A -> project_id=P, display_project_id=P
|
||||
|
||||
@@ -1178,6 +1178,8 @@
|
||||
<field name="legend_done" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<field attrs="{'invisible': [('project_id', '=', False)]}"
|
||||
name="task_properties" nolabel="1" columns="2"/>
|
||||
<notebook>
|
||||
<page name="description_page" string="Description">
|
||||
<field name="description" type="html" options="{'collaborative': true, 'resizable': false}"/>
|
||||
|
||||
Reference in New Issue
Block a user