Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
4040 Tampilan

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.

Avatar
Buang
Jawaban Terbai

 

if partner in users:
will always return False since users = []. As a result, your code is always calling message_subscribe with [].
Avatar
Buang
Penulis

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

Post Terkait Replies Tampilan Aktivitas
2
Agu 25
2449
3
Feb 25
3783
0
Mei 24
46
1
Apr 24
3499
4
Sep 23
5030