Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
4228 Weergaven

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
Annuleer
Beste antwoord

Try to use search_count() like this:

self.env['your.model'].search_count([('attribute', '=', 'value_of_attribute')])
Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
mrt. 25
6861
2
feb. 24
9951
3
mei 23
4651
1
jul. 24
842
1
jun. 24
1405