Skip to Content
Menú
This question has been flagged
1 Respondre
4226 Vistes

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
Descartar
Best Answer

Try to use search_count() like this:

self.env['your.model'].search_count([('attribute', '=', 'value_of_attribute')])
Avatar
Descartar
Related Posts Respostes Vistes Activitat
2
de març 25
6861
2
de febr. 24
9951
3
de maig 23
4651
1
de jul. 24
842
1
de juny 24
1405