Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
4244 Ansichten

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
Verwerfen
Beste Antwort

Try to use search_count() like this:

self.env['your.model'].search_count([('attribute', '=', 'value_of_attribute')])
Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
2
März 25
6868
2
Feb. 24
9961
3
Mai 23
4666
1
Juli 24
850
1
Juni 24
1408