Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4026 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

 

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

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

Powiązane posty Odpowiedzi Widoki Czynność
3
lut 25
3740
0
maj 24
46
1
kwi 24
3458
4
wrz 23
4997
2
wrz 23
7167