summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js
diff options
context:
space:
mode:
authorHiral Bhavsar <hbh@odoo.com>2020-06-02 12:10:19 +0000
committerHiral Bhavsar <hbh@odoo.com>2020-06-10 05:23:34 +0000
commitd46610ccb28ff0a6d890b0d8a2798d9e28370666 (patch)
tree19c70d545a5544b3823875b83d58e0c46a237cbc /addons/mail/static/src/js
parentbae86361247efb1dd4ac7f454b859461d4e5eb9c (diff)
[IMP] mail: few improvements on activity widget
PURPOSE Display the activity type through the icon of the widget and change the place to display to whom the activity is assigned (if it is not assigned to the current user). SPECIFICATION Display the deadline with a prefix as responsible if the activity assigned to another user than the current one (uid). Add a new 'activity_type_icon' field to the mail mixin to get the 'icon' of the type (fa-phone, fa-users, etc...) and for the list_activity widget, display it as an icon instead of the default 'fa-clock-o' icon. LINKS PR https://github.com/odoo/odoo/pull/52252 Task-2267579 closes odoo/odoo#52252 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/js')
-rw-r--r--addons/mail/static/src/js/activity.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/activity.js b/addons/mail/static/src/js/activity.js
index ed060fe1e8d..8a59c976ba3 100644
--- a/addons/mail/static/src/js/activity.js
+++ b/addons/mail/static/src/js/activity.js
@@ -768,6 +768,7 @@ const ListActivity = KanbanActivity.extend({
fieldDependencies: _.extend({}, KanbanActivity.prototype.fieldDependencies, {
activity_summary: {type: 'char'},
activity_type_id: {type: 'many2one', relation: 'mail.activity.type'},
+ activity_type_icon: {type: 'char'},
}),
label: _lt('Next Activity'),
@@ -795,6 +796,9 @@ const ListActivity = KanbanActivity.extend({
}
this.$('.o_activity_summary').text(text);
}
+ if (this.recordData.activity_type_icon) {
+ this.el.querySelector('.o_activity_btn > span').classList.replace('fa-clock-o', this.recordData.activity_type_icon);
+ }
},
//--------------------------------------------------------------------------