Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
4539 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
7235
2
Feb. 24
10750
3
Mai 23
5353
1
Juli 24
1066
1
Juni 24
1817