Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4242 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
6868
2
feb 24
9961
3
mag 23
4666
1
lug 24
849
1
giu 24
1408