From 540226d806660f40c5d9116ece9acf0fbcf40d8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 5 Sep 2018 13:11:10 +0200 Subject: [PATCH] [IMP] mail, contacts: allow to have actions in systray elements Purpose of this commit is to allow having an icon redirecting to the activity summary view in the partner activities section of systray. This is done by supporting an additional 'actions' list in the activity data given to the systray. It displays small icons that redirect to an Odoo action given its xml ID. This commit is linked to task ID 1882545 and PR #26797. --- addons/contacts/models/res_users.py | 5 +++++ addons/contacts/views/contact_views.xml | 16 ++++++++++++++++ .../src/js/systray/systray_activity_menu.js | 12 ++++++++++++ addons/mail/static/src/scss/discuss.scss | 12 +++++++++++- addons/mail/static/src/xml/systray.xml | 11 +++++++++++ 5 files changed, 55 insertions(+), 1 deletion(-) diff --git a/addons/contacts/models/res_users.py b/addons/contacts/models/res_users.py index 04e16b713c6..3a42daaa007 100644 --- a/addons/contacts/models/res_users.py +++ b/addons/contacts/models/res_users.py @@ -17,4 +17,9 @@ class Users(models.Model): if activity['model'] != 'res.partner': continue activity['icon'] = modules.module.get_module_icon('contacts') + activity['actions'] = [{ + 'icon': 'fa-clock-o', + 'name': 'Summary', + 'action_xmlid': 'contacts.action_contacts_summary' + }] return activities diff --git a/addons/contacts/views/contact_views.xml b/addons/contacts/views/contact_views.xml index 82da7aaca6b..efedaa7b393 100644 --- a/addons/contacts/views/contact_views.xml +++ b/addons/contacts/views/contact_views.xml @@ -34,6 +34,22 @@ + + Contacts + ir.actions.act_window + res.partner + form + activity,kanban,tree,form + + +

+ Create a contact in your address book +

+ Odoo helps you to easily track all activities related to a customer. +

+
+
+ +
+ + + +