Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4017 Lượt xem

Hi,

I have a list of users , I want it to be automatically added as followers when clicking send button .
I tried with this code , but still getting only the administrator as follower .
Any help please ?

def button_sent(self):

.....

users = []
for partner in self.partner_id.message_partner_ids.ids:
    if partner in users:
        users.append(partner)
self.message_subscribe(partner_ids=users)


Thanks.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

 

if partner in users:
will always return False since users = []. As a result, your code is always calling message_subscribe with [].
Ảnh đại diện
Huỷ bỏ
Tác giả

I did not put all the code .... , the list of users is filled

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 2 25
3723
0
thg 5 24
46
1
thg 4 24
3455
4
thg 9 23
4975
2
thg 9 23
7160