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

Hi. I'm trying to make a groupby filter for rma tags. I read that is not possible with many2many fields and then you have to create a many2one field and use it for the filter. I'm creating this field but I get the error "ValueError: Wrong value for rma.tag_id: rma.tag(18,)"


This is my field definition and compute function:

@api.depends('tag_ids')
def _compute_tag_ids_for_groupby_filter(self):
    for record in self:
        if (record.tag_ids and record.tag_ids[0]):
            record.tag_id = record.tag_ids[0] or False
   
tag_id = fields.Many2one('tag_ids', compute=_compute_tag_ids_for_groupby_filter, store=True)


Thanks a lot.



الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
فبراير 21
3675
2
يوليو 19
11174
1
يونيو 19
6999
1
أبريل 22
1830
2
سبتمبر 21
8677