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
6577 Widoki

I am trying to create private channel programmatically in Odoo12 but while creating it is giving me error that: The requested operation cant be completed due to security restrictions.

Then I tried like:

self.env['mail.channel'].sudo().create({})

Then it is creating private channel as a superuser

But problem is that when I log in into my account I am unable to view that private channels because those were created by superuser.

How to display them or how to create private channel without sudo()?


Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

You can create a private channel with your user id as a member in that channel:

self.env['mail.channel'].sudo().create({'channel_last_seen_partner_ids': [(4,self.env.user.id)]})


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
kwi 20
3042
0
kwi 21
2052
1
wrz 18
2867
1
sie 25
3403
1
gru 23
2212