Skip to Content
Menu
This question has been flagged
1 Atsakyti
4018 Rodiniai

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.

Portretas
Atmesti
Best Answer

 

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

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

Related Posts Replies Rodiniai Veikla
3
vas. 25
3723
0
geg. 24
46
1
bal. 24
3455
4
rugs. 23
4975
2
rugs. 23
7160