تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
4007 أدوات العرض

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

المنشورات ذات الصلة الردود أدوات العرض النشاط
3
فبراير 25
3721
0
مايو 24
46
1
أبريل 24
3451
4
سبتمبر 23
4971
2
سبتمبر 23
7153