Skip to content
Snippets Groups Projects
Commit dcb53f42 authored by Benoit Socias's avatar Benoit Socias
Browse files

[FIX] website_crm: restrict CRM columns to users having CRM rights


If leads are created using live chat, users without CRM rights cannot
access the visitors list anymore because the lead/opportunity
information is not available to them.

This commit limits the display of `lead_count` to the
`sales_team.group_sale_salesman` group.

In 14.0, the column still appeared without the `lead_count` value
displayed, but clicking on it raised a traceback.

Steps to reproduce:
- Install `website_crm_livechat`
- Login as Mitchell Admin
- Send a message in the live chat
- Go to Discuss
- Answer the livechat message with `/lead New`
- Go to Settings / Users / Marc Demo
- Remove the Sales rights
- Logout
- Login as Marc Demo
- Go to the Website / Reporting / Visitors page

=> The page could not be reached and an access right error message was
generated.

opw-3475301

closes odoo/odoo#133581

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent 1cbf0526
No related branches found
No related tags found
No related merge requests found
......@@ -60,10 +60,10 @@
<field name="lead_count"/>
</field>
<xpath expr="//div[@id='o_page_count']" position="after">
<div>Leads/Opportunities<span class="float-right font-weight-bold"><field name="lead_count"/></span></div>
<div groups="sales_team.group_sale_salesman">Leads/Opportunities<span class="float-right font-weight-bold"><field name="lead_count"/></span></div>
</xpath>
<xpath expr="//div[hasclass('w_visitor_kanban_actions_ungrouped')]" position="before">
<div class="col">
<div class="col" groups="sales_team.group_sale_salesman">
<b><field name="lead_count"/></b>
<div>Leads/Opportunities</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment