Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
953 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

Hello!

I'm currently experiencing the same issue with updating user_id in a controller. I was wondering if you managed to find a solution. So far, the only way I found to bypass it is using raw SQL.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
maj 22
4583
4
sty 17
4759
1
wrz 16
5575
2
sie 25
2051
1
lip 25
807