Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
6456 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
dub 20
2951
0
dub 21
1968
1
zář 18
2709
1
srp 25
3300
1
pro 23
2061