Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
4253 Visninger

Hi

I need to calculate the count of products by a given attribute  instead of gouping them by this same attibute.

What would be the code to add to a new filter?

Thanks in advance

Avatar
Kassér
Bedste svar

Try to use search_count() like this:

self.env['your.model'].search_count([('attribute', '=', 'value_of_attribute')])
Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
2
mar. 25
6871
2
feb. 24
9965
3
maj 23
4675
1
jul. 24
855
1
jun. 24
1409