From a6ae6d8217071051a92bd77aa297f9a8e0b4d00a Mon Sep 17 00:00:00 2001 From: Barad Mahendra Date: Mon, 22 Mar 2021 08:39:13 +0000 Subject: [PATCH] [IMP] project,web: generic improvement for project revamp Purpose of the commit is to do the generic improvement for the refactoring of project. So in this commit, done the following changes: - move the date_deadline and the tag_ids field to the right column - remove the warning 'by saving this change, the customer email and phone number will also be updated.' - track the priority field on task - move the deadline field above the fa-star and fa-clock-o icons - the name of archived tasks should be crossed out - project form add a 'deadline' field below the user_id one - project form remove the 'description' notebook - remove the 'project' field from the quickcreate of task. Related Ent PR: odoo/enterprise#16559 TaskID: 2451287 --- addons/project/models/project.py | 18 +--------------- addons/project/views/project_views.xml | 30 ++++++++++++++------------ 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/addons/project/models/project.py b/addons/project/models/project.py index f0545d49a77..3d85122c16c 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -571,7 +571,7 @@ class Task(models.Model): priority = fields.Selection([ ('0', 'Normal'), ('1', 'Important'), - ], default='0', index=True, string="Starred") + ], default='0', index=True, string="Starred", tracking=True) 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', compute='_compute_stage_id', @@ -616,7 +616,6 @@ class Task(models.Model): partner_phone = fields.Char( compute='_compute_partner_phone', inverse='_inverse_partner_phone', string="Phone", readonly=False, store=True, copy=False) - ribbon_message = fields.Char('Ribbon Message', compute='_compute_ribbon_message') partner_city = fields.Char(related='partner_id.city', readonly=False) manager_id = fields.Many2one('res.users', string='Project Manager', related='project_id.user_id', readonly=True) company_id = fields.Many2one( @@ -841,21 +840,6 @@ class Task(models.Model): if task.partner_id and task.partner_phone != task.partner_id.phone: task.partner_id.phone = task.partner_phone - @api.depends('partner_email', 'partner_phone', 'partner_id') - def _compute_ribbon_message(self): - for task in self: - will_write_email = task.partner_id and task.partner_email != task.partner_id.email - will_write_phone = task.partner_id and task.partner_phone != task.partner_id.phone - - if will_write_email and will_write_phone: - task.ribbon_message = _('By saving this change, the customer email and phone number will also be updated.') - elif will_write_email: - task.ribbon_message = _('By saving this change, the customer email will also be updated.') - elif will_write_phone: - task.ribbon_message = _('By saving this change, the customer phone number will also be updated.') - else: - task.ribbon_message = False - @api.constrains('parent_id') def _check_parent_id(self): if not self._check_recursion(): diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml index 6a910f0e154..06b5950f5d5 100644 --- a/addons/project/views/project_views.xml +++ b/addons/project/views/project_views.xml @@ -284,14 +284,12 @@ - - - +