In Odoo 17 im making a controller for a webhook.
I have methods for creating and editing leads.
With creating I have no problems, but when I'm trying to:
lead.sudo().write({'user_id': any_user_id})
i have an error: Access Denied by ACLs for operation: read, uid: 4, model: crm.lead. You are not allowed to access 'Lead/Opportunity' (crm.lead) records.
This operation is allowed for the following groups:
- Sales/Administrator
- Sales/User: Own Documents Only
Contact your administrator to request access if necessary.
But if I would like to change name of a lead for example(
lead.sudo().write({'name': any_name})
) it will work.
So I tried:
lead.with_user(SUPERUSER_ID).write
lead.with_context({'check_record_rules': False}).sudo().write
tried using in @http.route
auth='user'
Instead of
auth='public'
None of it works, also manually changing/adding access rules in odoo is not an option for me. So please, maybe someone had the same problem, any ideas what else i could try?