diff options
Diffstat (limited to 'addons/project/models/project.py')
| -rw-r--r-- | addons/project/models/project.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 32b98d6c374..8bf82cc5328 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -173,11 +173,11 @@ class Project(models.Model): def _get_default_favorite_user_ids(self): return [(6, 0, [self.env.uid])] - name = fields.Char("Name", index=True, required=True, track_visibility='onchange') + name = fields.Char("Name", index=True, required=True, tracking=True) active = fields.Boolean(default=True, help="If the active field is set to False, it will allow you to hide the project without removing it.") sequence = fields.Integer(default=10, help="Gives the sequence order when displaying a list of Projects.") - partner_id = fields.Many2one('res.partner', string='Customer', auto_join=True, track_visibility='onchange') + partner_id = fields.Many2one('res.partner', string='Customer', auto_join=True, tracking=True) company_id = fields.Many2one('res.company', string='Company', required=True, default=lambda self: self.env.user.company_id) currency_id = fields.Many2one('res.currency', related="company_id.currency_id", string="Currency", readonly=True) @@ -198,7 +198,7 @@ class Project(models.Model): task_ids = fields.One2many('project.task', 'project_id', string='Tasks', domain=['|', ('stage_id.fold', '=', False), ('stage_id', '=', False)]) color = fields.Integer(string='Color Index') - user_id = fields.Many2one('res.users', string='Project Manager', default=lambda self: self.env.user, track_visibility="onchange") + user_id = fields.Many2one('res.users', string='Project Manager', default=lambda self: self.env.user, tracking=True) alias_id = fields.Many2one('mail.alias', string='Alias', ondelete="restrict", required=True, help="Internal email associated with this project. Incoming emails are automatically synchronized " "with Tasks (or optionally Issues if the Issue Tracker module is installed).") @@ -217,7 +217,7 @@ class Project(models.Model): " them or by someone of their company.") doc_count = fields.Integer(compute='_compute_attached_docs_count', string="Number of documents attached") date_start = fields.Date(string='Start Date') - date = fields.Date(string='Expiration Date', index=True, track_visibility='onchange') + date = fields.Date(string='Expiration Date', index=True, tracking=True) subtask_project_id = fields.Many2one('project.project', string='Sub-task Project', ondelete="restrict", help="Project in which sub-tasks of the current project will be created. It can be the current project itself.") @@ -425,7 +425,7 @@ class Task(models.Model): return stages.browse(stage_ids) active = fields.Boolean(default=True) - name = fields.Char(string='Title', track_visibility='always', required=True, index=True) + name = fields.Char(string='Title', tracking=True, required=True, index=True) description = fields.Html(string='Description') priority = fields.Selection([ ('0', 'Low'), @@ -433,7 +433,7 @@ class Task(models.Model): ], default='0', index=True, string="Priority") sequence = fields.Integer(string='Sequence', index=True, default=10, help="Gives the sequence order when displaying a list of tasks.") - stage_id = fields.Many2one('project.task.type', string='Stage', ondelete='restrict', track_visibility='onchange', index=True, + stage_id = fields.Many2one('project.task.type', string='Stage', ondelete='restrict', tracking=True, index=True, default=_get_default_stage_id, group_expand='_read_group_stage_ids', domain="[('project_ids', '=', project_id)]", copy=False) tag_ids = fields.Many2many('project.tags', string='Tags', oldname='categ_ids') @@ -442,7 +442,7 @@ class Task(models.Model): ('done', 'Green'), ('blocked', 'Red')], string='Kanban State', copy=False, default='normal', required=True) - kanban_state_label = fields.Char(compute='_compute_kanban_state_label', string='Kanban State Label', track_visibility='onchange') + kanban_state_label = fields.Char(compute='_compute_kanban_state_label', string='Kanban State Label', tracking=True) create_date = fields.Datetime("Created On", readonly=True, index=True) write_date = fields.Datetime("Last Updated On", readonly=True, index=True) date_start = fields.Datetime(string='Starting Date', @@ -450,7 +450,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, track_visibility='onchange') + date_deadline = fields.Date(string='Deadline', index=True, copy=False, tracking=True) date_last_stage_update = fields.Datetime(string='Last Stage Update', default=fields.Datetime.now, index=True, @@ -460,15 +460,15 @@ class Task(models.Model): string='Project', default=lambda self: self.env.context.get('default_project_id'), index=True, - track_visibility='onchange', + tracking=True, 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.',track_visibility='onchange') + 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.',tracking=True) 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).") user_id = fields.Many2one('res.users', string='Assigned to', default=lambda self: self.env.uid, - index=True, track_visibility='always') + index=True, tracking=True) partner_id = fields.Many2one('res.partner', string='Customer', default=lambda self: self._get_default_partner()) |
