Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4436 Visualizzazioni

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
Abbandona
Risposta migliore

Try to use search_count() like this:

self.env['your.model'].search_count([('attribute', '=', 'value_of_attribute')])
Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
mar 25
7129
2
feb 24
10460
3
mag 23
5194
1
lug 24
979
1
giu 24
1679