Current behavior: if the user has no access to crm.lead, it shows the
error
You are not allowed to access 'Lead/Opportunity' (crm.lead) records.
This operation is allowed for the following groups:
- Extra Rights/Contact Creation
- Sales/Administrator
- Sales/User: Own Documents Only
- User types/Portal
Contact your administrator to request access if necessary.'
With this fix, First check the access to the model to count the records
or assign zero.
Related ticket #3546713closesodoo/odoo#140827
X-original-commit: d0f373ba5bd0f0aaa1f464158d02f1a25d781751
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>