Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
4237 Prikazi

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

Try to use search_count() like this:

self.env['your.model'].search_count([('attribute', '=', 'value_of_attribute')])
Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
mar. 25
6867
2
feb. 24
9956
3
maj 23
4655
1
jul. 24
844
1
jun. 24
1406