Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
6450 Представления

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


Аватар
Отменить
Лучший ответ

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


Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
апр. 20
2947
0
апр. 21
1966
1
сент. 18
2708
1
авг. 25
3299
1
дек. 23
2058