Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3594 Lượt xem

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

 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.



Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 2 22
2151
2
thg 3 24
2427
1
thg 10 22
8555
1
thg 9 22
3569
0
thg 7 22
3709