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: [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) --- addons/mail/static/src/js/systray/systray_activity_menu.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'addons/mail/static/src') diff --git a/addons/mail/static/src/js/systray/systray_activity_menu.js b/addons/mail/static/src/js/systray/systray_activity_menu.js index aada48357b5..98fd27dbbe4 100644 --- a/addons/mail/static/src/js/systray/systray_activity_menu.js +++ b/addons/mail/static/src/js/systray/systray_activity_menu.js @@ -59,6 +59,16 @@ var ActivityMenu = Widget.extend({ method: 'get_activity_view_id' }); }, + /** + * Return views to display when coming from systray depending on the model. + * + * @private + * @param {string} model + * @returns {Array[]} output the list of views to display. + */ + _getViewsList(model) { + return [[false, 'kanban'], [false, 'list'], [false, 'form']]; + }, /** * Update(render) activity system tray view on activity updation. * @private @@ -155,7 +165,7 @@ var ActivityMenu = Widget.extend({ type: 'ir.actions.act_window', name: data.model_name, res_model: data.res_model, - views: [[false, 'kanban'], [false, 'list'], [false, 'form']], + views: this._getViewsList(data.res_model), search_view_id: [false], domain: domain, context:context, -- cgit v1.2.3