Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
4030 Vistas

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
Descartar
Mejor respuesta

 

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

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

Publicaciones relacionadas Respuestas Vistas Actividad
2
ago 25
2400
3
feb 25
3758
0
may 24
46
1
abr 24
3482
4
sept 23
5013