From 76f5e41bcafc7a1d76a3029a3cbb17f74cbd2b5c Mon Sep 17 00:00:00 2001 From: ijas ahammed Date: Wed, 15 Sep 2021 08:54:55 +0000 Subject: [PATCH] [FIX] website_crm_partner_assign: hide activity types of other models Right now when editing the opportunity, all the activity types are listed in the drop-down, even those which are specific to other models. After this commit while editing the opportunity, we now display only activity types which are either specific for 'crm.lead', or those which are not linked with any models (common for all). TaskId-2443894 closes odoo/odoo#77924 X-original-commit: eda10ddcacdcb016c1282252d3b65dc37c934221 Signed-off-by: Thibault Delavallee (tde) --- addons/website_crm_partner_assign/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_crm_partner_assign/controllers/main.py b/addons/website_crm_partner_assign/controllers/main.py index 30223855dcf..3fc365c1f8b 100644 --- a/addons/website_crm_partner_assign/controllers/main.py +++ b/addons/website_crm_partner_assign/controllers/main.py @@ -164,7 +164,7 @@ class WebsiteAccount(CustomerPortal): 'opportunity': opp, 'user_activity': opp.sudo().activity_ids.filtered(lambda activity: activity.user_id == request.env.user)[:1], 'stages': request.env['crm.stage'].search([('is_won', '!=', True)], order='sequence desc, name desc, id desc'), - 'activity_types': request.env['mail.activity.type'].sudo().search([]), + 'activity_types': request.env['mail.activity.type'].sudo().search(['|', ('res_model_id.model', '=', opp._name), ('res_model_id', '=', False)]), 'states': request.env['res.country.state'].sudo().search([]), 'countries': request.env['res.country'].sudo().search([]), })