Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4028 Zobrazení

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
Zrušit
Nejlepší odpověď

 

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

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

Related Posts Odpovědi Zobrazení Aktivita
2
srp 25
2387
3
úno 25
3756
0
kvě 24
46
1
dub 24
3480
4
zář 23
5011