Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4236 Zobrazení

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
Zrušit
Nejlepší odpověď

Try to use search_count() like this:

self.env['your.model'].search_count([('attribute', '=', 'value_of_attribute')])
Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
bře 25
6866
Todays Filter Vyřešeno
2
úno 24
9955
3
kvě 23
4655
1
čvc 24
842
1
čvn 24
1406