@@ -302,7 +299,7 @@
project.task
-
+
diff --git a/addons/mail/models/mail_activity.py b/addons/mail/models/mail_activity.py
index 0822c3adb06..ca6caf35635 100644
--- a/addons/mail/models/mail_activity.py
+++ b/addons/mail/models/mail_activity.py
@@ -45,6 +45,7 @@ class MailActivityType(models.Model):
('days', 'days'),
('weeks', 'weeks'),
('months', 'months')], string="Delay units", help="Unit of delay", required=True, default='days')
+ delay_label = fields.Char(compute='_compute_delay_label')
delay_from = fields.Selection([
('current_date', 'after validation date'),
('previous_activity', 'after previous activity deadline')], string="Delay Type", help="Type of delay", required=True, default='previous_activity')
@@ -91,6 +92,14 @@ class MailActivityType(models.Model):
for activity_type in self:
activity_type.initial_res_model_id = activity_type.res_model_id
+ @api.depends('delay_unit', 'delay_count')
+ def _compute_delay_label(self):
+ selection_description_values = {
+ e[0]: e[1] for e in self._fields['delay_unit']._description_selection(self.env)}
+ for activity_type in self:
+ unit = selection_description_values[activity_type.delay_unit]
+ activity_type.delay_label = '%s %s' % (activity_type.delay_count, unit)
+
class MailActivity(models.Model):
""" An actual activity to perform. Activities are linked to
diff --git a/addons/mail/views/mail_activity_views.xml b/addons/mail/views/mail_activity_views.xml
index eaea8c27cb0..337455bae57 100644
--- a/addons/mail/views/mail_activity_views.xml
+++ b/addons/mail/views/mail_activity_views.xml
@@ -70,8 +70,7 @@
-
-
+
diff --git a/addons/note/views/note_views.xml b/addons/note/views/note_views.xml
index b6c586157d5..2f10994aa04 100644
--- a/addons/note/views/note_views.xml
+++ b/addons/note/views/note_views.xml
@@ -141,6 +141,7 @@
+
diff --git a/addons/project/models/project.py b/addons/project/models/project.py
index cc90d132df1..3cbed1b1107 100644
--- a/addons/project/models/project.py
+++ b/addons/project/models/project.py
@@ -559,7 +559,6 @@ class Task(models.Model):
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, tracking=True)
- date_deadline_formatted = fields.Char(compute='_compute_date_deadline_formatted')
date_last_stage_update = fields.Datetime(string='Last Stage Update',
index=True,
copy=False,
@@ -624,11 +623,6 @@ class Task(models.Model):
user_names = ', '.join(portal_users[:10].mapped('name'))
raise ValidationError(_("The project visibility setting doesn't allow portal users to see the project's tasks. (%s)") % user_names)
- @api.depends('date_deadline')
- def _compute_date_deadline_formatted(self):
- for task in self:
- task.date_deadline_formatted = format_date(self.env, task.date_deadline) if task.date_deadline else None
-
def _compute_attachment_ids(self):
for task in self:
attachment_ids = self.env['ir.attachment'].search([('res_id', '=', task.id), ('res_model', '=', 'project.task')]).ids
diff --git a/addons/project/static/src/js/project.js b/addons/project/static/src/js/project.js
deleted file mode 100644
index 5e0062a9965..00000000000
--- a/addons/project/static/src/js/project.js
+++ /dev/null
@@ -1,47 +0,0 @@
-odoo.define('project.update_kanban', function (require) {
-'use strict';
-
-var KanbanRecord = require('web.KanbanRecord');
-var basic_fields = require('web.basic_fields');
-var registry = require('web.field_registry');
-
-KanbanRecord.include({
- //--------------------------------------------------------------------------
- // Private
- //--------------------------------------------------------------------------
-
- /**
- * @override
- * @private
- */
- _openRecord: function () {
- if (this.modelName === 'project.project' && this.$(".o_project_kanban_boxes a").length) {
- this.$('.o_project_kanban_boxes a').first().click();
- } else {
- this._super.apply(this, arguments);
- }
- },
-
-});
-
-var FieldTaskClosedDeadline = basic_fields.FieldDate.extend({
- _renderReadonly: function () {
- if (this.value && this.value.toISOString()) {
- var deadline = moment(this.value.toISOString()).startOf('day');
- var task_closed = 'is_closed' in this.record.data && this.record.data.is_closed;
-
- if (!task_closed && deadline < moment().startOf('day')) {
- this.$el.addClass('text-danger font-weight-bold');
- } else if (!task_closed && deadline < moment().endOf('day')) {
- this.$el.addClass('text-warning font-weight-bold');
- }
- }
-
- this.$el.text(this._formatValue(this.value));
- }
-});
-
-registry.add('task_closed_deadline', FieldTaskClosedDeadline);
-
-return FieldTaskClosedDeadline;
-});
diff --git a/addons/project/views/project_assets.xml b/addons/project/views/project_assets.xml
index 347f620f386..e6e6dddeea2 100644
--- a/addons/project/views/project_assets.xml
+++ b/addons/project/views/project_assets.xml
@@ -3,7 +3,6 @@
-
diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml
index 80f725c5f0f..f35e189f9ae 100644
--- a/addons/project/views/project_views.xml
+++ b/addons/project/views/project_views.xml
@@ -291,7 +291,7 @@
-
+
@@ -404,7 +404,7 @@
-
+
@@ -666,7 +666,7 @@
domain="[('parent_id', '=', False)]"
attrs="{'invisible' : [('allow_subtasks', '=', False)]}"
/>
-
+
@@ -761,8 +761,6 @@
-
-
@@ -823,19 +821,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+