跳至內容
選單
此問題已被標幟
1 回覆
4009 瀏覽次數

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.

頭像
捨棄
最佳答案

 

if partner in users:
will always return False since users = []. As a result, your code is always calling message_subscribe with [].
頭像
捨棄
作者

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

相關帖文 回覆 瀏覽次數 活動
3
2月 25
3721
0
5月 24
46
1
4月 24
3451
4
9月 23
4971
2
9月 23
7153