Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4003 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ก.พ. 25
3721
0
พ.ค. 24
46
1
เม.ย. 24
3451
4
ก.ย. 23
4971
2
ก.ย. 23
7152