Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4596 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
7274
2
feb 24
10824
3
mag 23
5451
1
lug 24
1097
1
giu 24
1849