İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
6503 Görünümler

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()?


Avatar
Vazgeç
En İyi Yanıt

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)]})


Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Nis 20
2981
0
Nis 21
1986
1
Eyl 18
2745
1
Ağu 25
3324
1
Ara 23
2123