콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4060 화면

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.

아바타
취소
베스트 답변

 

if partner in users:
will always return False since users = []. As a result, your code is always calling message_subscribe with [].
아바타
취소
작성자

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

관련 게시물 답글 화면 활동
2
8월 25
2597
3
2월 25
3861
0
5월 24
46
1
4월 24
3556
4
9월 23
5097