From debeec1201d447b24674449cfaf6ebd94b4e41ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Mottet=20=28oms=29?= Date: Thu, 23 Apr 2020 08:31:30 +0000 Subject: [PATCH] [IMP] mail, crm: add view types for crm.lead model when coming from activity menu Purpose of this commit is to allow customization of view types available when using the activity menu. By default only kanban, list and form are available as before. Calendar, pivot, graph and activity have been added for leads, allowing better user experience in their use of activities. Task ID: 2228451 Community PR odoo/odoo#50042 Enterprise PR odoo/enterprise#10145 Signed-off-by: Thibault Delavallee (tde) --- .../static/src/js/systray_activity_menu.js | 26 +++++++++++++++++++ addons/crm/views/assets.xml | 6 +++++ .../src/js/systray/systray_activity_menu.js | 12 ++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 addons/crm/static/src/js/systray_activity_menu.js diff --git a/addons/crm/static/src/js/systray_activity_menu.js b/addons/crm/static/src/js/systray_activity_menu.js new file mode 100644 index 00000000000..fd3388b2335 --- /dev/null +++ b/addons/crm/static/src/js/systray_activity_menu.js @@ -0,0 +1,26 @@ +odoo.define('crm.systray.ActivityMenu', function (require) { +"use strict"; + +var ActivityMenu = require('mail.systray.ActivityMenu'); + +ActivityMenu.include({ + + //-------------------------------------------------- + // Private + //-------------------------------------------------- + + /** + * @override + */ + _getViewsList(model) { + if (model === "crm.lead") { + return [[false, 'kanban'], [false, 'list'], + [false, 'form'], [false, 'calendar'], + [false, 'pivot'], [false, 'graph'], + [false, 'activity'] + ]; + } + return this._super(...arguments); + }, +}); +}); diff --git a/addons/crm/views/assets.xml b/addons/crm/views/assets.xml index 5e601559a8e..a06748512c5 100644 --- a/addons/crm/views/assets.xml +++ b/addons/crm/views/assets.xml @@ -5,4 +5,10 @@ + +