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

category_ids = fields.Many2many(related='employee_id.category_ids', string='Tags')


In XML tree view:

 


I have tried the above. it's working fine. I can filter the data using category_ids.

But I can't group by using category_ids! I have tried using store=True. but it gives me below error:

psycopg2.errors.UndefinedTable: relation "none" does not exist

 

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

You cannot group by many2many fields in Odoo. When you provide a group by filter using a many2many field, You will get an error message like Assertion error.To provide a group by filter using many2many fields

Try refer the blog:

https://www.cybrosys.com/blog/how-to-use-group-by-for-many2many-fields-in-odoo-16


Hope it helps.



الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
فبراير 22
2151
2
مارس 24
2428
1
أكتوبر 22
8557
1
سبتمبر 22
3570
0
يوليو 22
3709