From 9339b0d6855d3aaed604cb3780afe702ff05aa19 Mon Sep 17 00:00:00 2001 From: alt-odoo Date: Fri, 27 Aug 2021 09:44:02 +0000 Subject: [PATCH] [FIX] website_crm: allow salesman to see page views of a lead Side effect of https://github.com/odoo/odoo/commit/69cc2911b52fd17b37fb71544574f63cf09dd17e. On a lead, there is a smart button allowing to see his page views on the website. In case we have many views, we are grouping them by page. Currently, the check on the pages is made through field page_ids which is restricted to Website Editor access group. We should allow a regular salesman to see page views without error, and this can be achived by using field website_track_ids.page_id instead. closes odoo/odoo#75761 X-original-commit: 76e1d609ad0e6d9a3dd2703185f4b87759823c70 Signed-off-by: Thibault Delavallee (tde) Signed-off-by: Alex Tuyls --- addons/website_crm/models/crm_lead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_crm/models/crm_lead.py b/addons/website_crm/models/crm_lead.py index 42ba502961b..83c7c8e7a92 100644 --- a/addons/website_crm/models/crm_lead.py +++ b/addons/website_crm/models/crm_lead.py @@ -33,7 +33,7 @@ class Lead(models.Model): action = self.env["ir.actions.actions"]._for_xml_id("website.website_visitor_page_action") action['domain'] = [('visitor_id', 'in', visitors.ids)] # avoid grouping if only few records - if len(visitors.website_track_ids.ids) > 15 and len(visitors.page_ids.ids) > 1: + if len(visitors.website_track_ids) > 15 and len(visitors.website_track_ids.page_id) > 1: action['context'] = {'search_default_group_by_page': '1'} return action