コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
4031 ビュー

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

関連投稿 返信 ビュー 活動
2
8月 25
2403
3
2月 25
3759
0
5月 24
46
1
4月 24
3485
4
9月 23
5013