a7d029afa715d4d6efa5a67d3a4cd1ff165370e8
Lead/Opportunity type
=====================
In the settings, if ``group_use_leads`` is checked, we add the group ``use_leads`` to all users in the group ``base.group_user``
To know if the setting is checked, in the model ``crm.lead``, we compute this code,
```
self.env['res.users'].has_group('crm.group_use_lead')
```
In 12.0
=======
When we compute ``sudo``, we are as the admin user.
The admin user is in the group ``base.group_user`` and so, he can be in the group ``use_leads``,
so everything work fine.
In 13.0
=======
When we perform a ``sudo``, we keep the same user.
But the visitor is not in the group ``base.group_user`` (he is in the group ``base.group_public``)
So, the visitor can never be in the group ``use_leads``
Fix
===
To fix it, we just need to compute the method ``has_group`` as the super user (which is in the group ``base.group_user``).
```
self.with_user(SUPERUSER_ID).env['res.users'].has_group('crm.group_use_lead')
```
Task #2124421
closes odoo/odoo#40418
X-original-commit: 8758bdc24297032ba8fd65f637a6990c6351dd27
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%